msal-react-tester
Version:
A npm package to simplify testing react application using msal-react
65 lines (60 loc) • 2.24 kB
JavaScript
/*! msal-react-tester v0.3.1 2023-08-10 */
'use strict';
const TEST_ACCESS_TOKEN = 'eyJhbGciOiJIUzI1NiJ9.eyJzY3AiOiJVc2VyLlJlYWQiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC9jb250b3NvIiwiYXBwX2Rpc3BsYXluYW1lIjoiYXBwbGljYXRpb24tbmFtZSIsInRpZCI6InRlbmFudC1pZCIsInRlbmFudF9yZWdpb25fc2NvcGUiOiJYWCIsImF1ZCI6IjAwMDAwMDAzLTAwMDAtMDAwMC1jMDAwLTAwMDAwMDAwMDAwMCIsInVuaXF1ZV9uYW1lIjoiam9obi5kb2VAY29udG9zby5jb20iLCJuYmYiOiIxNjU2NTk5NjI2IiwiYXBwaWQiOiJhcHAtaWQiLCJuYW1lIjoiSm9obiBEb2UiLCJleHAiOiIxNjU2NjA0NzY3IiwiaWF0IjoiMTY1NjU5OTYyNiIsImVtYWlsIjoiam9obi5kb2VAY29udG9zby5jb20ifQ.ftOvEUhqEFKWxIcxcYsgstgldO-31hIVwEhQ0hwwqWg';
//
// Token parsed is equal to :
//
/**
{
"alg": "HS256"
}.{
"aud": "00000003-0000-0000-c000-000000000000",
"iss": "https://sts.windows.net/contoso",
"nbf": "1656599626",
"iat": "1656599626",
"exp": "1656604767",
"app_displayname": "application-name",
"tid": "tenant-id",
"tenant_region_scope": "XX",
"unique_name": "john.doe@contoso.com",
"appid": "app-id",
"name": "John Doe",
"email": "john.doe@contoso.com",
"scp": "User.Read"
}.[Signature]
*/
const defaultTestAccountInfo = {
homeAccountId: "home-account-id",
localAccountId: "local-account-id",
environment: 'login.windows.net',
tenantId: "tenant-id",
username: 'john.doe@contoso.com',
name: 'John Doe',
};
const defaultTestAuthenticationResult = {
authority: 'https://login.microsoftonline.com',
uniqueId: 'unique-id',
tenantId: 'tenant-id',
scopes: ['openid', 'profile'],
idToken: 'test-id-token',
idTokenClaims: {},
accessToken: TEST_ACCESS_TOKEN,
fromCache: false,
correlationId: 'test-correlation-id',
expiresOn: new Date(Date.now() + 3600000),
account: defaultTestAccountInfo,
tokenType: 'Bearer',
};
const defaultTestAuthError = {
errorCode: 'test-error-code',
errorMessage: 'test-error-message',
subError: '',
correlationId: '',
setCorrelationId: function (correlationId) {
this.correlationId = correlationId;
},
name: 'test-error',
message: 'test-message',
};
export { TEST_ACCESS_TOKEN, defaultTestAccountInfo, defaultTestAuthError, defaultTestAuthenticationResult };
//# sourceMappingURL=testerConstants.js.map