-
Notifications
You must be signed in to change notification settings - Fork 444
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 built-in support for Oidc tokens #1282
Conversation
e1e440a
to
e838bb6
Compare
f492236
to
2a7ef2f
Compare
Added support for google clientId and improved error handling
@AlexF4Dev please check these alerts |
The first alert is probably false positive, because this is not a webapp. I have fixed regex warnings. |
src/common/constants.ts
Outdated
@@ -24,6 +24,11 @@ export const AzureActiveDirectoryDescription = "Prompts to sign in to Azure AD a | |||
export const AzureActiveDirectoryV2TokenVariableName = "$aadV2Token"; | |||
export const AzureActiveDirectoryV2TokenDescription = "Prompts to sign in to Azure AD V2 and adds the token to the request"; | |||
|
|||
export const OidcVariableName = "$oidcAccessToken"; | |||
export const OidcDescription = "Prompts to sign in to an Oidc provider and adds the token to the request"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra whitespace in description
src/utils/memoryCache.ts
Outdated
this.cache.set(key, value); | ||
} | ||
|
||
public clear(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra whitespace between access modifier public
and method name in this file
Trust nobody even IDP :-). I have added sanitizeHTML to prevent the script injection. Do we need support for DPOP/MTLS? It could be used to access API's protected by FAPI. |
@AlexF4Dev Merged, thanks |
The pull request adds support for OIDC access tokens. It uses PKCE flow to acquire tokens - no stored secrets required. The tokens are cached, and refresh token is used when the access token is expired. It can be used with any identity provider which supports PKCE OpenID Connect flow.
Example for Google:
Example for Microsoft:
The example will call an API with google access token. For google the app should be registered as UWP to use PKCE without the client secret.