# HG changeset patch # User durandn # Date 1455633960 -3600 # Node ID d5c583f9a0352609d86a15b7cd01b2087d3e19bb # Parent 5f50937893aca43900fb6a0e8227257b5a77517e fixed commited oauth settings + edited tmpls and readme diff -r 5f50937893ac -r d5c583f9a035 oauth/README.md --- a/oauth/README.md Tue Feb 16 15:43:00 2016 +0100 +++ b/oauth/README.md Tue Feb 16 15:46:00 2016 +0100 @@ -1,9 +1,24 @@ -# Example for OAuth 2 Server - -This is an example of OAuth 2 Server. - -Find more details on +# Example OAuth 2 Server & GED mock client # INSTALLATION +use a different virtualenv than the one for the django metaeducation app + +$ mkvirtualenv mtdc_oauth_env $ pip install -r requirements.txt + +# CONFIGURATION + +Edit client_settings.py.tmpl and oauth_settings.py.tmpl to match your renkan django app config. + +# RUNNING + +To run the oauth server: + +$ workon mtdc_oauth_env +$ python oauth.py + +To run the GED mock client: + +$ workon mtdc_oauth_env +$ python client.py \ No newline at end of file diff -r 5f50937893ac -r d5c583f9a035 oauth/settings/client_settings.py --- a/oauth/settings/client_settings.py Tue Feb 16 15:43:00 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - -class ClientSettings(object): - - CLIENT_ID = 'UxJQTxKRWXME4BORSAicA364ux5hRk3xaARR6Ft9' - CLIENT_SECRET = 'D1bWhjNrWWygfBIQ6C8yXfUmagXlQplVd4cVAF8y5CQDc3IQkE' - - # Oauth server config - BASE_URL = 'http://127.0.0.1:5000/api/' - REQUEST_TOKEN_URL = None - ACCESS_TOKEN_URL = 'http://127.0.0.1:5000/oauth/token' - AUTHORIZE_URL = 'http://127.0.0.1:5000/oauth/authorize' - REQUEST_TOKEN_PARAMS = {'scope': 'email'} - - # Renkan config - CREATE_RENKAN_URL = 'http://127.0.0.1:8001' \ No newline at end of file diff -r 5f50937893ac -r d5c583f9a035 oauth/settings/client_settings.py.tmpl --- a/oauth/settings/client_settings.py.tmpl Tue Feb 16 15:43:00 2016 +0100 +++ b/oauth/settings/client_settings.py.tmpl Tue Feb 16 15:46:00 2016 +0100 @@ -0,0 +1,15 @@ + +class ClientSettings(object): + + CLIENT_ID = '' + CLIENT_SECRET = '' + + # Oauth server config + BASE_URL = 'http://127.0.0.1:5000/api/' + REQUEST_TOKEN_URL = None + ACCESS_TOKEN_URL = 'http://127.0.0.1:5000/oauth/token' + AUTHORIZE_URL = 'http://127.0.0.1:5000/oauth/authorize' + REQUEST_TOKEN_PARAMS = {'scope': ''} + + # Renkan config + CREATE_RENKAN_URL = '' \ No newline at end of file diff -r 5f50937893ac -r d5c583f9a035 oauth/settings/oauth_settings.py --- a/oauth/settings/oauth_settings.py Tue Feb 16 15:43:00 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - -class OAuthSettings(object): - - CLIENT_REDIRECT_URIS = [ - 'http://localhost:8000/authorized', - 'http://127.0.0.1:8000/authorized', - 'http://127.0.1:8000/authorized', - 'http://127.1:8000/authorized', - ] - RENKAN_REDIRECT_URIS = [ - 'http://127.0.0.1:8001/accounts/mtdc/login/callback/', - 'http://127.0.0.1:8001/accounts/mtdc/login/callback/', - 'http://127.0.1:8001/accounts/mtdc/login/callback/', - 'http://127.1:8001/accounts/mtdc/login/callback/', - ] \ No newline at end of file diff -r 5f50937893ac -r d5c583f9a035 oauth/settings/oauth_settings.py.tmpl --- a/oauth/settings/oauth_settings.py.tmpl Tue Feb 16 15:43:00 2016 +0100 +++ b/oauth/settings/oauth_settings.py.tmpl Tue Feb 16 15:46:00 2016 +0100 @@ -0,0 +1,14 @@ + +class OAuthSettings(object): + + # Redirect URIs for GED mock client + CLIENT_REDIRECT_URIS = [ + 'http://localhost:8000/authorized', + 'http://127.0.0.1:8000/authorized', + 'http://127.0.1:8000/authorized', + 'http://127.1:8000/authorized', + ] + # Redirect URIs for Renkan django app + RENKAN_REDIRECT_URIS = [ + '/accounts/mtdc/login/callback/', + ] \ No newline at end of file