Skip to content

Commit

Permalink
Update OAuth2.0 controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
VJalili committed Aug 9, 2017
1 parent 3a90758 commit 57f5a5f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/galaxy/webapps/galaxy/controllers/oauth2.py
Expand Up @@ -7,16 +7,17 @@
log = logging.getLogger(__name__)
from galaxy import web
from galaxy.web.base.controller import BaseUIController
from oauth2client import client
import requests
import hashlib

class OAuth2( BaseUIController ):

@web.expose
def authenticate(self, trans, **kwargs):
return
@web.require_login( "authenticate against Google identity provider" )
def google_authn(self, trans, **kwargs):
if trans.user is None:
# Only logged in users are allowed here.
return
return trans.response.send_redirect( web.url_for( trans.app.authnz_manager.authenticate( "Google", trans ) ) )

@web.expose
def callback(self, trans, **kwargs):
return
def google_callback(self, trans, **kwargs):
trans.app.authnz_manager.callback( "Google", kwargs[ 'state' ], kwargs[ 'code' ], trans )

0 comments on commit 57f5a5f

Please sign in to comment.