-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add refresh token support for Azure AD OAuth provider #1599
base: main
Are you sure you want to change the base?
Conversation
- Store refresh token from OAuth response in provider instance - Add refresh token to user metadata in get_user_info method - Enable offline_access scope to receive refresh tokens This enhancement allows applications to persist refresh tokens for maintaining long-term access to Azure AD resources.
@SigveSjovold nice PR! Can you add this to the AzureHybrid class as well? |
@hayescode Thanks! Added it now. |
The code looks good to me, but I am not working with Azure so not really in a position to test it. It would be amazing to have feedback from someone else before merging. @hayescode Any chance you could give this one a go? |
@dokterbob works great for me using Azure Hybrid authentication. It adds a new key to user.metadata called 'refresh_token'. @cl.oauth_callback
def login(
provider_id: str,
token: str,
raw_user_data: Dict[str, str],
default_user: cl.User,
id_token: Optional[str],
) -> Optional[cl.PersistedUser]:
print("Default User Metadata:")
for key, value in default_user.metadata.items():
print(f"{key}: {value}") |
Description
This PR adds support for handling refresh tokens in the Azure AD OAuth provider. This enables applications to maintain long-term access to Azure AD resources without requiring users to re-authenticate.
Changes
get_token
methodoffline_access
scope to enable refresh token supportTesting
I have tested these changes by: