#123 add OAuth2 example with mock tokeninfo endpoint

This commit is contained in:
hjacobs
2016-01-22 19:36:50 +01:00
parent fdb4a3daf2
commit fcb20c7e05
5 changed files with 109 additions and 0 deletions

17
examples/oauth2/app.py Executable file
View 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)