reusable generateOAuthState helper, introduce in InspectorOAuthClientProvider and in oauth-state-machine, add test
This commit is contained in:
parent
113b612b99
commit
929b930618
1 changed files with 29 additions and 8 deletions
|
|
@ -8,6 +8,7 @@ import {
|
|||
OAuthMetadata,
|
||||
} from "@modelcontextprotocol/sdk/shared/auth.js";
|
||||
import { SESSION_KEYS, getServerSpecificKey } from "./constants";
|
||||
import { generateOAuthState } from "@/utils/oauthUtils";
|
||||
|
||||
export const getClientInformationFromSessionStorage = async ({
|
||||
serverUrl,
|
||||
|
|
@ -75,6 +76,10 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
|
|||
return window.location.origin + "/oauth/callback";
|
||||
}
|
||||
|
||||
state(): string | Promise<string> {
|
||||
return generateOAuthState();
|
||||
}
|
||||
|
||||
get clientMetadata(): OAuthClientMetadata {
|
||||
return {
|
||||
redirect_uris: [this.redirectUrl],
|
||||
|
|
|
|||
Loading…
Reference in a new issue