First time here? Check out the FAQ!

Revision history  [back]

Authentication and django_authopenid_association

So lets say I have another authentication system just like google or yahoo where we push the user to go and input username and password. Once they put username and password via successful user will redirect to askbot site (Redirect via https is handle in apache settings).

Basically my post request is a SAML2/post and I get a SAMLResponse. So my question is can I add a record to below mentioned table with the url that I am directing user to put credentials and then use authentication attributes log them on askbot side (such as creating the record in auth_user table).

mysql> desc django_authopenid_association;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | int(11)      | NO   | PRI | NULL    | auto_increment |
| server_url | longtext     | NO   |     | NULL    |                |
| handle     | varchar(255) | NO   |     | NULL    |                |
| secret     | longtext     | NO   |     | NULL    |                |
| issued     | int(11)      | NO   |     | NULL    |                |
| lifetime   | int(11)      | NO   |     | NULL    |                |
| assoc_type | longtext     | NO   |     | NULL    |                |
+------------+--------------+------+-----+---------+----------------+

Once I have the record on this table, I could use something like this:

     elif method == 'umn':
        try:
            assoc = UserAssociation.objects.get(mylogin_url=mylogin_url)
            user = assoc.user
        except UserAssociation.DoesNotExist:
            return None
        except UserAssociation.MultipleObjectsReturned:
            logging.critical(
                'duplicate openid url in the database!!! %s' % mylogin_url
            )
            return None

(I am not really sure whats next from here but just want to confirm if this would be a right approach)

Also I want to know adding a record to django_authopenid_association is a manual process or if there is a config file to add authentication urls.

Authentication and django_authopenid_association

So lets say I have another authentication system just like google or yahoo where we push the user to go and input username and password. Once they put username and password via successful user will redirect to askbot site (Redirect via https is handle in apache settings).

Basically my post request is a SAML2/post and I get a SAMLResponse. So my question is can I add a record to below mentioned table with the url that I am directing user to put credentials and then use authentication attributes log them on askbot side (such as creating the record in auth_user table).

mysql> desc django_authopenid_association;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | int(11)      | NO   | PRI | NULL    | auto_increment |
| server_url | longtext     | NO   |     | NULL    |                |
| handle     | varchar(255) | NO   |     | NULL    |                |
| secret     | longtext     | NO   |     | NULL    |                |
| issued     | int(11)      | NO   |     | NULL    |                |
| lifetime   | int(11)      | NO   |     | NULL    |                |
| assoc_type | longtext     | NO   |     | NULL    |                |
+------------+--------------+------+-----+---------+----------------+

Once I have the record on this table, I could use something like this:

     elif method == 'umn':
        try:
            assoc = UserAssociation.objects.get(mylogin_url=mylogin_url)
            user = assoc.user
        except UserAssociation.DoesNotExist:
            return None
        except UserAssociation.MultipleObjectsReturned:
            logging.critical(
                'duplicate openid url in the database!!! %s' % mylogin_url
            )
            return None

(I am not really sure whats next from here but just want to confirm if this would be a right approach)

Also I want to know adding a record to django_authopenid_association is a manual process or if there is a config file to add authentication urls.