Forum Discussion

harryboy's avatar
harryboy
Occasional Contributor
6 years ago

Flask OAuth2 Server

I am creating a REST API using Swagger based on the PetStore example.
I am using the Python-Flask Generated Server.
I need to use OAuth2 for authentication.
 
From what I undeerstand I need to:
1. Implement a user database.
2. Log in with a registered user and return an Access Token.
3. Use this token with any subsequent API calls to access resources.
 
I see examples where one uses e.g. FaceBook or Google to obtain the AccessToken but I want my server to handle everything.
 
Are there any examples of a python OAuth2 Server that works with Swagger?
When I test the online PetStore Editor: https://editor.swagger.io it directs me to this link:
http://petstore.swagger.io/oauth/login.jsp which says: "You can find the source code to the server" but the link is broken :(