Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Name | Type | Default | Description
`debug` | boolean | `false` | If set to true, Flask will be in debug mode and write stacktraces if an error occurs. Some extra logging is also printed.
`port` | number | `5443` | The port that the Flask server should listen to
`disable_https` | boolean | `false` | Set to true to run on http
`logout_endpoint` | string | | The URL to the logout endpoint at the authentication service. If set, the user will be redirected here after a logout has been made in the application.
`base_url` | string | | base url to be added to internal redirects. If this is not configured, the base url will be extracted from the first request to the index page
`send_parameters_via`|string | `query_string`|How request parameters should be sent to the authorization endpoint. Valid values are `query_string`, `request_object` or `request_uri`.
`request_object_keys`|JSON object| | The JSON Web Key (JWK) used to sign JWTs used when sending authorization request parameters by-value in a request object or by reference in a request URI. For example:<br>`{`<br>`"kty":"RSA",`<br>`"n":"0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",`<br>`"e":"AQAB",`<br>`"d":"X4cTteJY_gn4FYPsXB8rdXix5vwsg1FLN5E3EaG6RJoVH-HLLKD9M7dx5oo7GURknchnrRweUkC7hT5fJLM0WbFAKNLWY2vv7B6NqXSzUvxT0_YSfqijwp3RTzlBaCxWp4doFk5N2o8Gy_nHNKroADIkJ46pRUohs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hAVRU",`<br>`"alg":"RS256",`<br>`"kid":"2011-04-29"`<br>`}`
Expand Down
9 changes: 4 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,10 @@ def logout():
if 'session_id' in session:
del _session_store[session['session_id']]
session.clear()
if 'logout_endpoint' in _config:
print "Logging out against", _config['logout_endpoint']
return redirect(_config['logout_endpoint'] + '?redirect_uri=' + _config['base_url'])
return redirect_with_baseurl('/')


print "Logging out at ", _config['end_session_endpoint']
logout_request = _config['end_session_endpoint'] + '?client_id=' + _config['client_id'] + '&post_logout_redirect_uri=' + _config['base_url']
return redirect(logout_request)

@_app.route('/refresh')
def refresh():
Expand Down
2 changes: 1 addition & 1 deletion client.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def get_authn_req_url(self, session, acr, forceAuthN, scope, forceConsent, allow
'state': state,
'code_challenge': code_challenge,
'code_challenge_method': "S256",
'redirect_uri': self.config.get('redirect_uri', "")}
'redirect_uri': self.config.get('redirect_uri')}

if 'authn_parameters' in self.config:
request_args.update(self.config['authn_parameters'])
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Config():
'issuer',
'audience',
'jwks_uri',
'logout_endpoint',
'end_session_endpoint',
'port',
'redirect_uri',
'revocation_endpoint',
Expand Down
10 changes: 5 additions & 5 deletions settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"logout_endpoint": "https://localhost:8443/dev/authn/authenticate/logout",
"issuer": "https://localhost:8443/dev/oauth/anonymous",
"api_endpoint": "http://localhost:5555/hello_world",
"issuer": "https://localhost:8443/oauth/v2/oauth-anonymous",
"api_endpoint": "https://localhost:3000",
"verify_ssl_server": false,
"debug": true,
"scope": "openid profile email address phone",
"send_parameters_via": "query",
"client_id": "client-two",
"client_secret": "sEcrEt@3wo",
"client_id": "python-client",
"client_secret": "Password1",
"redirect_uri": "https://localhost:5443/callback",
"request_object_key": {
"kty": "RSA",
"n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
Expand Down