generated from yanyongyu/python-poetry-template
-
-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
@app.route('/callback')
def callback(request: Request):
code = request.query_params.get('code')
github = GitHub(OAuthAppAuthStrategy(settings.CLIENT_ID, settings.SECRET_ID))
user_github = github.with_auth(github.auth.as_web_user(code))
# Or exchange the code for tokens and store them
auth: OAuthTokenAuthStrategy = github.auth.as_web_user(code).exchange_token(github)
access_token = auth.token
refresh_token = auth.refresh_token
print(access_token)
print(refresh_token)
user_github = github.with_auth(
OAuthTokenAuthStrategy(
settings.CLIENT_ID, settings.SECRET_ID, refresh_token=refresh_token
)
)
resp = user_github.rest.users.get_authenticated()
user = resp.parsed_data
print(user.email)
When I try to implement github authentication with oauth application,
In above, I provide valid client_id and secret_id
but I am not getting refresh_token , user.email
Can you please help me what might be the reason that I am facing this issue.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested