-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
OIDC: Token refresher class #3769
Conversation
Co-authored-by: Richard van der Hoff <[email protected]>
src/http-api/interface.ts
Outdated
/** | ||
* @experimental | ||
*/ | ||
export type AccessTokens = { | ||
accessToken: string; | ||
refreshToken?: string; | ||
}; | ||
/** | ||
* @experimental | ||
*/ | ||
export type TokenRefreshFunction = (refreshToken: string) => Promise<AccessTokens>; |
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.
please document these things
const authConfig = { | ||
issuer: "https://issuer.org/", | ||
}; | ||
const clientId = "test-client-id"; | ||
const redirectUri = "https://test.org"; | ||
const deviceId = "abc123"; | ||
const idTokenClaims = { | ||
exp: Date.now() / 1000 + 100000, | ||
aud: clientId, | ||
iss: authConfig.issuer, | ||
sub: "123", | ||
iat: 123, | ||
}; | ||
const scope = `openid urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:${deviceId}`; |
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.
could do with a few comments on some of the other things here too please!
Co-authored-by: Richard van der Hoff <[email protected]>
@richvdh if we have agreed guidelines about active voice, tone, etc; they should be documented. I don't think several rounds of these reviews are a good use of either of our time. |
I'm afraid I just see it as writing clear, factual documentation - something we've agreed at a team that we need to do better at. |
@kerryarchibald I've sent you a longer response privately, but for the public record: please can you document the |
@richvdh have added documentation for |
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.
Thank you!
For element-hq/element-web#25839
See js-sdk #3764 and matrix-org/matrix-react-sdk#11699 for use.
Adds an abstract class responsible for refreshing OIDC native tokens.
Exposes abstract function
persistTokens
to allow consumer to persist tokens in storage.Will be used in matrix-react-sdk to create
tokenRefreshFunction
as passed to http-apiChecklist
This change is marked as an internal change (Task), so will not be included in the changelog.