-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Revant Nandgaonkar edited this page Mar 22, 2020
·
4 revisions
# install app in bench
bench get-app https://github.com/revant/oauth2_client
# install app on site
bench --site <site-name> install-app oauth2_client- Register the client on your authorization server of choice.
- Add
Connected AppEntry - Easiest way to fill up the form is by querying openid-configuration endpoint
- Fill the configuration endpoint and click get
Get OpenID Configuration. - Note the redirect URL (Must be registered on Authorization server)
Create the object of connected app
connected_app = frappe.get_doc("Connected App", "bloomstack")client_token = connected_app.get_client_token()
print(client_token.access_token) # use the token ConnectedApp.get_user_token() returns url string if no token was found, redirect user to initiate authorization code flow
It will return the valid token if previous token was found
user_token = connected_app.get_user_token()