I am trying to build a simple gramex application. where i need to authorize user from linkedin, outlook, Github & gmail.
Please share some code snippet.
I am trying to build a simple gramex application. where i need to authorize user from linkedin, outlook, Github & gmail.
Please share some code snippet.
url:
auth/github:
pattern: /$YAMLURL/github
handler: OAuth2
kwargs:
# Create app at https://code.gramener.com/admin/applications/
client_id: 'YOUR_APP_CLIENT_ID' # https://github.com/settings/connections/applications/
client_secret: 'YOUR_APP_SECRET_ID'
authorize:
url: 'https://github.com/login/oauth/authorize'
scope: [repo, gist, user]
access_token:
url: 'https://github.com/login/oauth/access_token'
body:
grant_type: 'authorization_code'
user_info:
url: 'https://api.github.com/user'
headers:
Authorization: 'Bearer {access_token}'
redirect:
query: next
header: Referer
url: .
This is the code snippet for Github with OAuth2
https://docs.github.com/en/developers/apps/building-oauth-apps