Add prompt=consent for OIDC offline_access scope (#681)

This commit is contained in:
Daniel Kelleher 2025-07-14 15:47:09 +02:00 • committed by GitHub
commit a9c907dd70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -714,6 +714,20 @@ describe("OAuth Authorization", () => {
expect(authorizationUrl.searchParams.has("state")).toBe(false);
});
// OpenID Connect requires that the user is prompted for consent if the scope includes 'offline_access'
it("includes consent prompt parameter if scope includes 'offline_access'", async () => {
const { authorizationUrl } = await startAuthorization(
"https://auth.example.com",
{
clientInformation: validClientInfo,
redirectUrl: "http://localhost:3000/callback",
scope: "read write profile offline_access",
}
);
expect(authorizationUrl.searchParams.get("prompt")).toBe("consent");
});
it("uses metadata authorization_endpoint when provided", async () => {
const { authorizationUrl } = await startAuthorization(
"https://auth.example.com",