Skip to content

Commit

Permalink
Merge pull request AzureAD#1140 from AzureAD/authorization-code-flow-…
Browse files Browse the repository at this point in the history
…storage

Authorization Code Flow for Single Page Applications: Browser Storage Implementation
  • Loading branch information
Prithvi Kanherkar committed Dec 9, 2019
2 parents 485cb20 + 2bbe1e7 commit a2b8aae
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ export { CodeResponse } from "./response/CodeResponse";
export { AuthError, AuthErrorMessage } from "./error/AuthError";
export { ClientAuthError, ClientAuthErrorMessage } from "./error/ClientAuthError";
export { ClientConfigurationError, ClientConfigurationErrorMessage } from "./error/ClientConfigurationError";
// Constants
export { Constants, TemporaryCacheKeys, PersistentCacheKeys } from "./utils/Constants";
37 changes: 37 additions & 0 deletions src/utils/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,43 @@
* Licensed under the MIT License.
*/

export const Constants = {
// Prefix for all library cache entries
CACHE_PREFIX: "msal",
// Resource delimiter - used for certain cache entries
RESOURCE_DELIM: "|"
};

/**
* @hidden
* CacheKeys for MSAL
*/
export enum TemporaryCacheKeys {
AUTHORITY = "authority",
ACQUIRE_TOKEN_ACCOUNT = "acquireTokenAccount",
SESSION_STATE = "session.state",
REQUEST_STATE = "state.request",
NONCE_IDTOKEN = "nonce.idtoken",
ORIGIN_URI = "login.request",
RENEW_STATUS = "token.renew.status",
URL_HASH = "urlHash",
INTERACTION_STATUS = "interaction.status",
REQUEST_PARAMS = "request.params",
REDIRECT_REQUEST = "redirect.request"
};

export enum PersistentCacheKeys {
ID_TOKEN = "idtoken",
CLIENT_INFO = "client.info",
ADAL_ID_TOKEN = "adal.idtoken",
};

export enum ErrorCacheKeys {
LOGIN_ERROR = "login.error",
ERROR = "error",
ERROR_DESC = "error.description"
}

/**
* List of pre-established trusted host URLs.
*/
Expand Down

0 comments on commit a2b8aae

Please sign in to comment.