mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-09 20:37:46 +00:00
#123 add OAuth2 example with mock tokeninfo endpoint
This commit is contained in:
17
examples/oauth2/app.py
Executable file
17
examples/oauth2/app.py
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
'''
|
||||
Basic example of a resource server
|
||||
'''
|
||||
|
||||
import connexion
|
||||
import flask
|
||||
|
||||
|
||||
def get_secret() -> str:
|
||||
# the token's uid will be set in request.user
|
||||
return 'You are: {uid}'.format(uid=flask.request.user)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = connexion.App(__name__)
|
||||
app.add_api('app.yaml')
|
||||
app.run(port=8080)
|
||||
Reference in New Issue
Block a user