Skip to content

Commit ef89cf9

Browse files
authored
Merge pull request #38 from curityio/feature/guides
Updates as part of writing code example article
2 parents f8bac4d + 2b99605 commit ef89cf9

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Name | Type | Default | Description
3737
`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.
3838
`port` | number | `5443` | The port that the Flask server should listen to
3939
`disable_https` | boolean | `false` | Set to true to run on http
40-
`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.
4140
`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
4241
`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`.
4342
`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_YSfqijwp3RT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SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU",`<br>`"alg":"RS256",`<br>`"kid":"2011-04-29"`<br>`}`

app.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,10 @@ def logout():
130130
if 'session_id' in session:
131131
del _session_store[session['session_id']]
132132
session.clear()
133-
if 'logout_endpoint' in _config:
134-
print "Logging out against", _config['logout_endpoint']
135-
return redirect(_config['logout_endpoint'] + '?redirect_uri=' + _config['base_url'])
136-
return redirect_with_baseurl('/')
137-
133+
134+
print "Logging out at ", _config['end_session_endpoint']
135+
logout_request = _config['end_session_endpoint'] + '?client_id=' + _config['client_id'] + '&post_logout_redirect_uri=' + _config['base_url']
136+
return redirect(logout_request)
138137

139138
@_app.route('/refresh')
140139
def refresh():

client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def get_authn_req_url(self, session, acr, forceAuthN, scope, forceConsent, allow
201201
'state': state,
202202
'code_challenge': code_challenge,
203203
'code_challenge_method': "S256",
204-
'redirect_uri': self.config.get('redirect_uri', "")}
204+
'redirect_uri': self.config.get('redirect_uri')}
205205

206206
if 'authn_parameters' in self.config:
207207
request_args.update(self.config['authn_parameters'])

config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Config():
3333
'issuer',
3434
'audience',
3535
'jwks_uri',
36-
'logout_endpoint',
36+
'end_session_endpoint',
3737
'port',
3838
'redirect_uri',
3939
'revocation_endpoint',

settings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"logout_endpoint": "https://localhost:8443/dev/authn/authenticate/logout",
3-
"issuer": "https://localhost:8443/dev/oauth/anonymous",
4-
"api_endpoint": "http://localhost:5555/hello_world",
2+
"issuer": "https://localhost:8443/oauth/v2/oauth-anonymous",
3+
"api_endpoint": "https://localhost:3000",
54
"verify_ssl_server": false,
65
"debug": true,
76
"scope": "openid profile email address phone",
87
"send_parameters_via": "query",
9-
"client_id": "client-two",
10-
"client_secret": "sEcrEt@3wo",
8+
"client_id": "python-client",
9+
"client_secret": "Password1",
10+
"redirect_uri": "https://localhost:5443/callback",
1111
"request_object_key": {
1212
"kty": "RSA",
1313
"n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",

0 commit comments

Comments
 (0)