modules inc

This commit is contained in:
nannal
2021-07-15 23:10:20 +03:00
parent 6bb353de89
commit 5921b02b7c
845 changed files with 105299 additions and 121 deletions

View File

@@ -0,0 +1,18 @@
/**
* BaseAuthRequest
* - scopes - Array of scopes the application is requesting access to.
* - claims - A stringified claims request which will be added to all /authorize and /token calls
* - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens. Defaults to https://login.microsoftonline.com/common. If using the same authority for all request, authority should set on client application object and not request, to avoid resolving authority endpoints multiple times.
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
* - resourceRequestMethod - HTTP Request type used to request data from the resource (i.e. "GET", "POST", etc.). Used for proof-of-possession flows.
* - resourceRequestUri - URI that token will be used for. Used for proof-of-possession flows.
*/
export declare type BaseAuthRequest = {
authority: string;
correlationId: string;
scopes: Array<string>;
claims?: string;
resourceRequestMethod?: string;
resourceRequestUri?: string;
};
//# sourceMappingURL=BaseAuthRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BaseAuthRequest.d.ts","sourceRoot":"","sources":["../../src/request/BaseAuthRequest.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,oBAAY,eAAe,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC"}

View File

@@ -0,0 +1,23 @@
import { BaseAuthRequest } from "./BaseAuthRequest";
import { AuthenticationScheme } from "../utils/Constants";
/**
* Request object passed by user to acquire a token from the server exchanging a valid authorization code (second leg of OAuth2.0 Authorization Code flow)
*
* - scopes - Array of scopes the application is requesting access to.
* - claims - A stringified claims request which will be added to all /authorize and /token calls
* - authority: - URL of the authority, the security token service (STS) from which MSAL will acquire tokens. If authority is set on client application object, this will override that value. Overriding the value will cause for authority validation to happen each time. If the same authority will be used for all request, set on the application object instead of the requests.
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
* - redirectUri - The redirect URI of your app, where the authority will redirect to after the user inputs credentials and consents. It must exactly match one of the redirect URIs you registered in the portal.
* - authenticationScheme - The type of token retrieved. Defaults to "Bearer". Can also be type "pop".
* - code - The authorization_code that the user acquired in the first leg of the flow.
* - codeVerifier - The same code_verifier that was used to obtain the authorization_code. Required if PKCE was used in the authorization code grant request.For more information, see the PKCE RFC: https://tools.ietf.org/html/rfc7636
* - resourceRequestMethod - HTTP Request type used to request data from the resource (i.e. "GET", "POST", etc.). Used for proof-of-possession flows.
* - resourceRequestUri - URI that token will be used for. Used for proof-of-possession flows.
*/
export declare type CommonAuthorizationCodeRequest = BaseAuthRequest & {
authenticationScheme: AuthenticationScheme;
code: string;
redirectUri: string;
codeVerifier?: string;
};
//# sourceMappingURL=CommonAuthorizationCodeRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CommonAuthorizationCodeRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonAuthorizationCodeRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH,oBAAY,8BAA8B,GAAG,eAAe,GAAG;IAC3D,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC"}

View File

@@ -0,0 +1,49 @@
import { ResponseMode, AuthenticationScheme } from "../utils/Constants";
import { StringDict } from "../utils/MsalTypes";
import { BaseAuthRequest } from "./BaseAuthRequest";
import { AccountInfo } from "../account/AccountInfo";
/**
* Request object passed by user to retrieve a Code from the server (first leg of authorization code grant flow)
*
* - authenticationScheme - The type of token retrieved. Defaults to "Bearer". Can also be type "pop".
* - scopes - Array of scopes the application is requesting access to.
* - claims - A stringified claims request which will be added to all /authorize and /token calls
* - authority - Url of the authority which the application acquires tokens from.
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
* - redirectUri - The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.
* - extraScopesToConsent - Scopes for a different resource when the user needs consent upfront.
* - responseMode - Specifies the method that should be used to send the authentication result to your app. Can be query, form_post, or fragment. If no value is passed in, it defaults to query.
* - codeChallenge - Used to secure authorization code grant via Proof of Key for Code Exchange (PKCE). For more information, see the PKCE RCF:https://tools.ietf.org/html/rfc7636
* - codeChallengeMethod - The method used to encode the code verifier for the code challenge parameter. Can be "plain" or "S256". If excluded, code challenge is assumed to be plaintext. For more information, see the PKCE RCF: https://tools.ietf.org/html/rfc7636
* - state - A value included in the request that is also returned in the token response. A randomly generated unique value is typically used for preventing cross site request forgery attacks. The state is also used to encode information about the user's state in the app before the authentication request occurred.
* - prompt - Indicates the type of user interaction that is required.
* login: will force the user to enter their credentials on that request, negating single-sign on
* none: will ensure that the user isn't presented with any interactive prompt. if request can't be completed via single-sign on, the endpoint will return an interaction_required error
* consent: will the trigger the OAuth consent dialog after the user signs in, asking the user to grant permissions to the app
* select_account: will interrupt single sign-=on providing account selection experience listing all the accounts in session or any remembered accounts or an option to choose to use a different account
* - account - AccountInfo obtained from a getAccount API. Will be used in certain scenarios to generate login_hint if both loginHint and sid params are not provided.
* - loginHint - Can be used to pre-fill the username/email address field of the sign-in page for the user, if you know the username/email address ahead of time. Often apps use this parameter during re-authentication, having already extracted the username from a previous sign-in using the preferred_username claim.
* - sid - Session ID, unique identifier for the session. Available as an optional claim on ID tokens.
* - domainHint - Provides a hint about the tenant or domain that the user should use to sign in. The value of the domain hint is a registered domain for the tenant.
* - extraQueryParameters - String to string map of custom query parameters.
* - nonce - A value included in the request that is returned in the id token. A randomly generated unique value is typically used to mitigate replay attacks.
* - resourceRequestMethod - HTTP Request type used to request data from the resource (i.e. "GET", "POST", etc.). Used for proof-of-possession flows.
* - resourceRequestUri - URI that token will be used for. Used for proof-of-possession flows.
*/
export declare type CommonAuthorizationUrlRequest = BaseAuthRequest & {
authenticationScheme: AuthenticationScheme;
redirectUri: string;
responseMode: ResponseMode;
account?: AccountInfo;
codeChallenge?: string;
codeChallengeMethod?: string;
domainHint?: string;
extraQueryParameters?: StringDict;
extraScopesToConsent?: Array<string>;
loginHint?: string;
nonce?: string;
prompt?: string;
sid?: string;
state?: string;
};
//# sourceMappingURL=CommonAuthorizationUrlRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CommonAuthorizationUrlRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonAuthorizationUrlRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,oBAAY,6BAA6B,GAAG,eAAe,GAAG;IAC1D,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}

View File

@@ -0,0 +1,12 @@
import { BaseAuthRequest } from "./BaseAuthRequest";
/**
* CommonClientCredentialRequest
* - scopes - Array of scopes the application is requesting access to.
* - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens.
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
* - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
*/
export declare type CommonClientCredentialRequest = BaseAuthRequest & {
skipCache?: boolean;
};
//# sourceMappingURL=CommonClientCredentialRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CommonClientCredentialRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonClientCredentialRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;GAMG;AACH,oBAAY,6BAA6B,GAAG,eAAe,GAAG;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}

View File

@@ -0,0 +1,19 @@
import { DeviceCodeResponse } from "../response/DeviceCodeResponse";
import { BaseAuthRequest } from "./BaseAuthRequest";
/**
* Parameters for Oauth2 device code flow.
* - scopes - Array of scopes the application is requesting access to.
* - authority: - URL of the authority, the security token service (STS) from which MSAL will acquire tokens. If authority is set on client application object, this will override that value. Overriding the value will cause for authority validation to happen each time. If the same authority will be used for all request, set on the application object instead of the requests.
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
* - deviceCodeCallback - Callback containing device code response. Message should be shown to end user. End user can then navigate to the verification_uri, input the user_code, and input credentials.
* - cancel - Boolean to cancel polling of device code endpoint. While the user authenticates on a separate device, MSAL polls the the token endpoint of security token service for the interval specified in the device code response (usually 15 minutes). To stop polling and cancel the request, set cancel=true.
* - resourceRequestMethod - HTTP Request type used to request data from the resource (i.e. "GET", "POST", etc.). Used for proof-of-possession flows.
* - resourceRequestUri - URI that token will be used for. Used for proof-of-possession flows.
* - timeout - Timeout period in seconds which the user explicitly configures for the polling of the device code endpoint. At the end of this period; assuming the device code has not expired yet; the device code polling is stopped and the request cancelled. The device code expiration window will always take precedence over this set period.
*/
export declare type CommonDeviceCodeRequest = BaseAuthRequest & {
deviceCodeCallback: (response: DeviceCodeResponse) => void;
cancel?: boolean;
timeout?: number;
};
//# sourceMappingURL=CommonDeviceCodeRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CommonDeviceCodeRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonDeviceCodeRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,oBAAY,uBAAuB,GAAG,eAAe,GAAI;IACrD,kBAAkB,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC3D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}

View File

@@ -0,0 +1,15 @@
import { AccountInfo } from "../account/AccountInfo";
/**
* CommonEndSessionRequest
* - account - Account object that will be logged out of. All tokens tied to this account will be cleared.
* - postLogoutRedirectUri - URI to navigate to after logout page.
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
* - idTokenHint - ID Token used by B2C to validate logout if required by the policy
*/
export declare type CommonEndSessionRequest = {
correlationId: string;
account?: AccountInfo;
postLogoutRedirectUri?: string | null;
idTokenHint?: string;
};
//# sourceMappingURL=CommonEndSessionRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CommonEndSessionRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonEndSessionRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;GAMG;AACH,oBAAY,uBAAuB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB,CAAC"}

View File

@@ -0,0 +1,13 @@
import { BaseAuthRequest } from "./BaseAuthRequest";
/**
* - scopes - Array of scopes the application is requesting access to.
* - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens.
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
* - oboAssertion - The access token that was sent to the middle-tier API. This token must have an audience of the app making this OBO request.
* - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
*/
export declare type CommonOnBehalfOfRequest = BaseAuthRequest & {
oboAssertion: string;
skipCache?: boolean;
};
//# sourceMappingURL=CommonOnBehalfOfRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CommonOnBehalfOfRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonOnBehalfOfRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;GAMG;AACH,oBAAY,uBAAuB,GAAG,eAAe,GAAG;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}

View File

@@ -0,0 +1,17 @@
import { BaseAuthRequest } from "./BaseAuthRequest";
import { AuthenticationScheme } from "../utils/Constants";
/**
* CommonRefreshTokenRequest
* - scopes - Array of scopes the application is requesting access to.
* - claims - A stringified claims request which will be added to all /authorize and /token calls
* - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens.
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
* - refreshToken - A refresh token returned from a previous request to the Identity provider.
* - resourceRequestMethod - HTTP Request type used to request data from the resource (i.e. "GET", "POST", etc.). Used for proof-of-possession flows.
* - resourceRequestUri - URI that token will be used for. Used for proof-of-possession flows.
*/
export declare type CommonRefreshTokenRequest = BaseAuthRequest & {
refreshToken: string;
authenticationScheme: AuthenticationScheme;
};
//# sourceMappingURL=CommonRefreshTokenRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CommonRefreshTokenRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonRefreshTokenRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;GASG;AACH,oBAAY,yBAAyB,GAAG,eAAe,GAAG;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,oBAAoB,CAAC;CAC9C,CAAC"}

View File

@@ -0,0 +1,18 @@
import { AccountInfo } from "../account/AccountInfo";
import { BaseAuthRequest } from "./BaseAuthRequest";
/**
* SilentFlow parameters passed by the user to retrieve credentials silently
* - scopes - Array of scopes the application is requesting access to.
* - claims - A stringified claims request which will be added to all /authorize and /token calls. When included on a silent request, cache lookup will be skipped and token will be refreshed.
* - authority - Url of the authority which the application acquires tokens from.
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
* - account - Account entity to lookup the credentials.
* - forceRefresh - Forces silent requests to make network calls if true.
* - resourceRequestMethod - HTTP Request type used to request data from the resource (i.e. "GET", "POST", etc.). Used for proof-of-possession flows.
* - resourceRequestUri - URI that token will be used for. Used for proof-of-possession flows.
*/
export declare type CommonSilentFlowRequest = BaseAuthRequest & {
account: AccountInfo;
forceRefresh: boolean;
};
//# sourceMappingURL=CommonSilentFlowRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CommonSilentFlowRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonSilentFlowRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,oBAAY,uBAAuB,GAAG,eAAe,GAAG;IACpD,OAAO,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;CACzB,CAAC"}

View File

@@ -0,0 +1,17 @@
import { BaseAuthRequest } from "./BaseAuthRequest";
/**
* CommonUsernamePassword parameters passed by the user to retrieve credentials
* Note: The latest OAuth 2.0 Security Best Current Practice disallows the password grant entirely. This flow is added for internal testing.
*
* - scopes - Array of scopes the application is requesting access to.
* - claims - A stringified claims request which will be added to all /authorize and /token calls. When included on a silent request, cache lookup will be skipped and token will be refreshed.
* - authority - Url of the authority which the application acquires tokens from.
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
* - username - username of the client
* - password - credentials
*/
export declare type CommonUsernamePasswordRequest = BaseAuthRequest & {
username: string;
password: string;
};
//# sourceMappingURL=CommonUsernamePasswordRequest.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CommonUsernamePasswordRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonUsernamePasswordRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,oBAAY,6BAA6B,GAAG,eAAe,GAAG;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC"}

View File

@@ -0,0 +1,175 @@
import { ResponseMode } from "../utils/Constants";
import { StringDict } from "../utils/MsalTypes";
import { LibraryInfo } from "../config/ClientConfiguration";
export declare class RequestParameterBuilder {
private parameters;
constructor();
/**
* add response_type = code
*/
addResponseTypeCode(): void;
/**
* add response_mode. defaults to query.
* @param responseMode
*/
addResponseMode(responseMode?: ResponseMode): void;
/**
* add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios
* @param scopeSet
* @param addOidcScopes
*/
addScopes(scopes: string[], addOidcScopes?: boolean): void;
/**
* add clientId
* @param clientId
*/
addClientId(clientId: string): void;
/**
* add redirect_uri
* @param redirectUri
*/
addRedirectUri(redirectUri: string): void;
/**
* add post logout redirectUri
* @param redirectUri
*/
addPostLogoutRedirectUri(redirectUri: string): void;
/**
* add id_token_hint to logout request
* @param idTokenHint
*/
addIdTokenHint(idTokenHint: string): void;
/**
* add domain_hint
* @param domainHint
*/
addDomainHint(domainHint: string): void;
/**
* add login_hint
* @param loginHint
*/
addLoginHint(loginHint: string): void;
/**
* add sid
* @param sid
*/
addSid(sid: string): void;
/**
* add claims
* @param claims
*/
addClaims(claims?: string, clientCapabilities?: Array<string>): void;
/**
* add correlationId
* @param correlationId
*/
addCorrelationId(correlationId: string): void;
/**
* add library info query params
* @param libraryInfo
*/
addLibraryInfo(libraryInfo: LibraryInfo): void;
/**
* add prompt
* @param prompt
*/
addPrompt(prompt: string): void;
/**
* add state
* @param state
*/
addState(state: string): void;
/**
* add nonce
* @param nonce
*/
addNonce(nonce: string): void;
/**
* add code_challenge and code_challenge_method
* - throw if either of them are not passed
* @param codeChallenge
* @param codeChallengeMethod
*/
addCodeChallengeParams(codeChallenge: string, codeChallengeMethod: string): void;
/**
* add the `authorization_code` passed by the user to exchange for a token
* @param code
*/
addAuthorizationCode(code: string): void;
/**
* add the `authorization_code` passed by the user to exchange for a token
* @param code
*/
addDeviceCode(code: string): void;
/**
* add the `refreshToken` passed by the user
* @param refreshToken
*/
addRefreshToken(refreshToken: string): void;
/**
* add the `code_verifier` passed by the user to exchange for a token
* @param codeVerifier
*/
addCodeVerifier(codeVerifier: string): void;
/**
* add client_secret
* @param clientSecret
*/
addClientSecret(clientSecret: string): void;
/**
* add clientAssertion for confidential client flows
* @param clientAssertion
*/
addClientAssertion(clientAssertion: string): void;
/**
* add clientAssertionType for confidential client flows
* @param clientAssertionType
*/
addClientAssertionType(clientAssertionType: string): void;
/**
* add OBO assertion for confidential client flows
* @param clientAssertion
*/
addOboAssertion(oboAssertion: string): void;
/**
* add grant type
* @param grantType
*/
addRequestTokenUse(tokenUse: string): void;
/**
* add grant type
* @param grantType
*/
addGrantType(grantType: string): void;
/**
* add client info
*
*/
addClientInfo(): void;
/**
* add extraQueryParams
* @param eQparams
*/
addExtraQueryParameters(eQparams: StringDict): void;
addClientCapabilitiesToClaims(claims?: string, clientCapabilities?: Array<string>): string;
/**
* adds `username` for Password Grant flow
* @param username
*/
addUsername(username: string): void;
/**
* adds `password` for Password Grant flow
* @param password
*/
addPassword(password: string): void;
/**
* add pop_jwk to query params
* @param cnfString
*/
addPopToken(cnfString: string): void;
/**
* Utility to create a URL from the params map
*/
createQueryString(): string;
}
//# sourceMappingURL=RequestParameterBuilder.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"RequestParameterBuilder.d.ts","sourceRoot":"","sources":["../../src/request/RequestParameterBuilder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiC,YAAY,EAA6G,MAAM,oBAAoB,CAAC;AAG5L,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,uBAAuB;IAEhC,OAAO,CAAC,UAAU,CAAsB;;IAMxC;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAM3B;;;OAGG;IACH,eAAe,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI;IAOlD;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,aAAa,GAAE,OAAc,GAAG,IAAI;IAMhE;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC;;;OAGG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKzC;;;OAGG;IACH,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKnD;;;OAGG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIzC;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAIvC;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIrC;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIzB;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI;IAMpE;;;OAGG;IACH,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAI7C;;;OAGG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IAQ9C;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK/B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM7B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B;;;;;OAKG;IACH,sBAAsB,CAClB,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,MAAM,GAC5B,IAAI;IAUP;;;OAGG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIxC;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIjC;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAI3C;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAI3C;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAI3C;;;OAGG;IACH,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI;IAIjD;;;OAGG;IACH,sBAAsB,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI;IAIzD;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAI3C;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI1C;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIrC;;;OAGG;IACH,aAAa,IAAI,IAAI;IAIrB;;;OAGG;IACH,uBAAuB,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI;IAOnD,6BAA6B,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IA6B1F;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC;;;OAGG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAOpC;;OAEG;IACH,iBAAiB,IAAI,MAAM;CAS9B"}

View File

@@ -0,0 +1,34 @@
import { StringDict } from "../utils/MsalTypes";
/**
* Validates server consumable params from the "request" objects
*/
export declare class RequestValidator {
/**
* Utility to check if the `redirectUri` in the request is a non-null value
* @param redirectUri
*/
static validateRedirectUri(redirectUri: string): void;
/**
* Utility to validate prompt sent by the user in the request
* @param prompt
*/
static validatePrompt(prompt: string): void;
static validateClaims(claims: string): void;
/**
* Utility to validate code_challenge and code_challenge_method
* @param codeChallenge
* @param codeChallengeMethod
*/
static validateCodeChallengeParams(codeChallenge: string, codeChallengeMethod: string): void;
/**
* Utility to validate code_challenge_method
* @param codeChallengeMethod
*/
static validateCodeChallengeMethod(codeChallengeMethod: string): void;
/**
* Removes unnecessary or duplicate query parameters from extraQueryParameters
* @param request
*/
static sanitizeEQParams(eQParams: StringDict, queryParams: Map<string, string>): StringDict;
}
//# sourceMappingURL=RequestValidator.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"RequestValidator.d.ts","sourceRoot":"","sources":["../../src/request/RequestValidator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;GAEG;AACH,qBAAa,gBAAgB;IAEzB;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAI,IAAI;IAMtD;;;OAGG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAI,IAAI;IAa5C,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAI,IAAI;IAQ5C;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,aAAa,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAI,IAAI;IAQ7F;;;OAGG;IACH,MAAM,CAAC,2BAA2B,CAAC,mBAAmB,EAAE,MAAM,GAAI,IAAI;IAWtE;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAI,UAAU;CAc/F"}

View File

@@ -0,0 +1,83 @@
/**
* The ScopeSet class creates a set of scopes. Scopes are case-insensitive, unique values, so the Set object in JS makes
* the most sense to implement for this class. All scopes are trimmed and converted to lower case strings in intersection and union functions
* to ensure uniqueness of strings.
*/
export declare class ScopeSet {
private scopes;
constructor(inputScopes: Array<string>);
/**
* Factory method to create ScopeSet from space-delimited string
* @param inputScopeString
* @param appClientId
* @param scopesRequired
*/
static fromString(inputScopeString: string): ScopeSet;
/**
* Used to validate the scopes input parameter requested by the developer.
* @param {Array<string>} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.
* @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not
*/
private validateInputScopes;
/**
* Check if a given scope is present in this set of scopes.
* @param scope
*/
containsScope(scope: string): boolean;
/**
* Check if a set of scopes is present in this set of scopes.
* @param scopeSet
*/
containsScopeSet(scopeSet: ScopeSet): boolean;
/**
* Check if set of scopes contains only the defaults
*/
containsOnlyOIDCScopes(): boolean;
/**
* Appends single scope if passed
* @param newScope
*/
appendScope(newScope: string): void;
/**
* Appends multiple scopes if passed
* @param newScopes
*/
appendScopes(newScopes: Array<string>): void;
/**
* Removes element from set of scopes.
* @param scope
*/
removeScope(scope: string): void;
/**
* Removes default scopes from set of scopes
* Primarily used to prevent cache misses if the default scopes are not returned from the server
*/
removeOIDCScopes(): void;
/**
* Combines an array of scopes with the current set of scopes.
* @param otherScopes
*/
unionScopeSets(otherScopes: ScopeSet): Set<string>;
/**
* Check if scopes intersect between this set and another.
* @param otherScopes
*/
intersectingScopeSets(otherScopes: ScopeSet): boolean;
/**
* Returns size of set of scopes.
*/
getScopeCount(): number;
/**
* Returns the scopes as an array of string values
*/
asArray(): Array<string>;
/**
* Prints scopes into a space-delimited string
*/
printScopes(): string;
/**
* Prints scopes into a space-delimited lower-case string (used for caching)
*/
printScopesLowerCase(): string;
}
//# sourceMappingURL=ScopeSet.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ScopeSet.d.ts","sourceRoot":"","sources":["../../src/request/ScopeSet.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,qBAAa,QAAQ;IAEjB,OAAO,CAAC,MAAM,CAAc;gBAEhB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;IAYtC;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,gBAAgB,EAAE,MAAM,GAAG,QAAQ;IAMrD;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAO3B;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAOrC;;;OAGG;IACH,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;IAQ7C;;OAEG;IACH,sBAAsB,IAAI,OAAO;IAWjC;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMnC;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI;IAQ5C;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOhC;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IAMxB;;;OAGG;IACH,cAAc,CAAC,WAAW,EAAE,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC;IAUlD;;;OAGG;IACH,qBAAqB,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO;IAgBrD;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;OAEG;IACH,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;IAMxB;;OAEG;IACH,WAAW,IAAI,MAAM;IAQrB;;OAEG;IACH,oBAAoB,IAAI,MAAM;CAGjC"}