Skip to content

Commit

Permalink
initial add of janrain authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacdontjelindell committed Jun 18, 2013
1 parent 33d53d2 commit ce3b5b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ def user():
form = auth()

# this looks horrible but it seems to be the only way to add a CSS class to the submit button
form[0][-1][1][0]['_class'] = 'btn btn-small'
form.element(_id='submit_record__row')[1][0]['_class']='btn btn-small'


# parse the referring URL to see if we can prepopulate the course_id field in
# the registration form
Expand Down
9 changes: 9 additions & 0 deletions models/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ def __call__(self, value):
## register with janrain.com, write your domain:api_key in private/janrain.key
#from gluon.contrib.login_methods.rpx_account import use_janrain
#use_janrain(auth,filename='private/janrain.key')
from gluon.contrib.login_methods.rpx_account import RPXAccount
janrain_form = RPXAccount(request,
api_key='20cd9290c5a55568548e1deba04a67afc5c263be',
domain='runestoneinteractive',
url='http://localhost:8000/runestone/default/user/login')
# TODO make url environment-aware

from gluon.contrib.login_methods.extended_login_form import ExtendedLoginForm
auth.settings.login_form = ExtendedLoginForm(auth, janrain_form)

#########################################################################
## Define your tables below (or better in another model file) for example
Expand Down

0 comments on commit ce3b5b2

Please sign in to comment.