@alfresco/js-api 9.4.0-19336680353 → 9.4.0-19357604483
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2015/package.json +1 -1
- package/esm2015/src/authentication/oauth2Auth.js +2 -6
- package/esm2015/src/authentication/oauth2Auth.js.map +1 -1
- package/esm2015/src/authentication/oauth2Config.js.map +1 -1
- package/esm5/package.json +1 -1
- package/esm5/src/authentication/oauth2Auth.js +2 -6
- package/esm5/src/authentication/oauth2Auth.js.map +1 -1
- package/esm5/src/authentication/oauth2Config.js.map +1 -1
- package/package.json +1 -1
- package/src/authentication/oauth2Auth.js +2 -6
- package/src/authentication/oauth2Auth.js.map +1 -1
- package/src/authentication/oauth2Config.js.map +1 -1
- package/typings/package.json +1 -1
- package/typings/src/authentication/oauth2Config.d.ts +0 -1
package/esm2015/package.json
CHANGED
|
@@ -55,9 +55,6 @@ export class Oauth2Auth extends AlfrescoApiClient {
|
|
|
55
55
|
if (this.config.oauth2.scope === undefined || this.config.oauth2.scope === null) {
|
|
56
56
|
throw new Error('Missing the required oauth2 scope parameter');
|
|
57
57
|
}
|
|
58
|
-
if (this.config.oauth2.secret === undefined || this.config.oauth2.secret === null) {
|
|
59
|
-
this.config.oauth2.secret = '';
|
|
60
|
-
}
|
|
61
58
|
if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) {
|
|
62
59
|
throw new Error('Missing redirectUri required parameter');
|
|
63
60
|
}
|
|
@@ -432,8 +429,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
|
|
|
432
429
|
username,
|
|
433
430
|
password,
|
|
434
431
|
grant_type: 'password',
|
|
435
|
-
client_id: this.config.oauth2.clientId
|
|
436
|
-
client_secret: this.config.oauth2.secret
|
|
432
|
+
client_id: this.config.oauth2.clientId
|
|
437
433
|
};
|
|
438
434
|
const contentTypes = ['application/x-www-form-urlencoded'];
|
|
439
435
|
const accepts = ['application/json'];
|
|
@@ -462,7 +458,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
|
|
|
462
458
|
this.refreshTokenIntervalPolling.unref();
|
|
463
459
|
}
|
|
464
460
|
refreshToken() {
|
|
465
|
-
const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId
|
|
461
|
+
const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId);
|
|
466
462
|
const headerParams = {
|
|
467
463
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
468
464
|
'Cache-Control': 'no-cache',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2Auth.js","sourceRoot":"","sources":["oauth2Auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAepD,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAiC7C,YAAY,MAAyB,EAAE,WAAwB,EAAE,UAAuB;QACpF,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QA1BzB,qBAAgB,GAAG,IAAI,CAAC;QAIhC,cAAS,GAKL;YACA,QAAQ,EAAE,SAAS;YACnB,SAAS,EAAE,SAAS;YACpB,aAAa,EAAE,SAAS;YACxB,gBAAgB,EAAE,SAAS;SAC9B,CAAC;QAEF,oBAAe,GAAmB;YAC9B,MAAM,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;YAC3B,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,EAAE;SAChB,CAAC;QAGF,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAI5B,IAAI,CAAC,OAAO,GAAG,OAA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,GAAG,gCAAgC,AAAnC,CAAoC;AACrD,qCAA0B,GAAG,mCAAmC,AAAtC,CAAuC;AACjE,6BAAkB,GAAG,iCAAiC,AAApC,CAAqC","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EventEmitter } from 'eventemitter3';\nimport { AlfrescoApiClient } from '../alfrescoApiClient';\nimport { AlfrescoApiConfig } from '../alfrescoApiConfig';\nimport { Authentication } from './authentication';\nimport { AuthenticationApi } from '../api/auth-rest-api';\nimport { AlfrescoApi } from '../alfrescoApi';\nimport { Storage } from '../storage';\nimport { HttpClient } from '../api-clients/http-client.interface';\nimport { PathMatcher } from '../utils/path-matcher';\n\ndeclare const Buffer: any;\n\ndeclare let window: Window;\n\ninterface Userinfo {\n name: string;\n given_name?: string;\n family_name?: string;\n preferred_username?: string;\n email?: string;\n picture?: string;\n}\n\nexport class Oauth2Auth extends AlfrescoApiClient {\n static readonly DEFAULT_AUTHORIZATION_URL = '/protocol/openid-connect/auth';\n static readonly DEFAULT_TOKEN_URL = '/protocol/openid-connect/token';\n static readonly DEFAULT_USER_INFO_ENDPOINT = '/protocol/openid-connect/userinfo';\n static readonly DEFAULT_LOGOUT_URL = '/protocol/openid-connect/logout';\n\n private refreshTokenIntervalPolling: any;\n private refreshTokenTimeoutIframe: any;\n private checkAccessToken = true;\n\n hashFragmentParams: any;\n token: string;\n discovery: {\n loginUrl?: string;\n logoutUrl?: string;\n tokenEndpoint?: string;\n userinfoEndpoint?: string;\n } = {\n loginUrl: undefined,\n logoutUrl: undefined,\n tokenEndpoint: undefined,\n userinfoEndpoint: undefined\n };\n\n authentications: Authentication = {\n oauth2: { accessToken: '' },\n type: 'oauth2',\n basicAuth: {}\n };\n\n iFrameHashListener: any;\n pathMatcher = new PathMatcher();\n\n constructor(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi, httpClient?: HttpClient) {\n super(undefined, httpClient);\n this.storage = Storage.getInstance();\n\n this.className = 'Oauth2Auth';\n\n if (config) {\n this.setConfig(config, alfrescoApi);\n }\n }\n\n setConfig(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi) {\n this.config = config;\n this.storage.setDomainPrefix(config.domainPrefix);\n\n if (this.config.oauth2) {\n if (this.config.oauth2.host === undefined || this.config.oauth2.host === null) {\n throw new Error('Missing the required oauth2 host parameter');\n }\n\n if (this.config.oauth2.clientId === undefined || this.config.oauth2.clientId === null) {\n throw new Error('Missing the required oauth2 clientId parameter');\n }\n\n if (this.config.oauth2.scope === undefined || this.config.oauth2.scope === null) {\n throw new Error('Missing the required oauth2 scope parameter');\n }\n\n if (this.config.oauth2.secret === undefined || this.config.oauth2.secret === null) {\n this.config.oauth2.secret = '';\n }\n\n if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) {\n throw new Error('Missing redirectUri required parameter');\n }\n\n if (!this.config.oauth2.refreshTokenTimeout) {\n this.config.oauth2.refreshTokenTimeout = 300000;\n }\n\n if (!this.config.oauth2.redirectSilentIframeUri) {\n let context = '';\n if (typeof window !== 'undefined') {\n context = window.location.origin;\n }\n this.config.oauth2.redirectSilentIframeUri = context + '/assets/silent-refresh.html';\n }\n\n this.basePath = this.config.oauth2.host; //Auth Call\n\n this.host = this.config.oauth2.host;\n\n this.discoveryUrls();\n\n if (this.hasContentProvider()) {\n this.exchangeTicketListener(alfrescoApi);\n }\n\n this.initOauth();\n }\n }\n\n initOauth() {\n if (!this.config.oauth2.implicitFlow && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n }\n\n if (this.config.oauth2.implicitFlow) {\n this.checkFragment('nonce');\n }\n }\n\n discoveryUrls() {\n this.discovery.loginUrl = this.config.oauth2.authorizationUrl || this.host + Oauth2Auth.DEFAULT_AUTHORIZATION_URL;\n this.discovery.logoutUrl = this.config.oauth2.logoutUrl || this.host + Oauth2Auth.DEFAULT_LOGOUT_URL;\n this.discovery.tokenEndpoint = this.config.oauth2.tokenUrl || this.host + Oauth2Auth.DEFAULT_TOKEN_URL;\n this.discovery.userinfoEndpoint = this.config.oauth2.userinfoEndpoint || this.host + Oauth2Auth.DEFAULT_USER_INFO_ENDPOINT;\n }\n\n getProfile(): Promise<Userinfo> {\n const postBody = {};\n const pathParams = {};\n const queryParams = {};\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {};\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n return this.callCustomApi(\n this.discovery.userinfoEndpoint,\n 'GET',\n pathParams,\n queryParams,\n headerParams,\n formParams,\n postBody,\n contentTypes,\n accepts\n );\n }\n\n hasContentProvider(): boolean {\n return this.config.provider === 'ECM' || this.config.provider === 'ALL';\n }\n\n checkFragment(nonceKey?: string, externalHash?: any): any {\n // jshint ignore:line\n this.hashFragmentParams = this.getHashFragmentParams(externalHash);\n\n if (this.hashFragmentParams && this.hashFragmentParams.error === undefined) {\n this.useFragmentTimeLogin(nonceKey);\n } else {\n this.refreshBrowserLogin();\n }\n }\n\n private refreshBrowserLogin() {\n if (this.config.oauth2.silentLogin && !this.isPublicUrl()) {\n this.implicitLogin();\n }\n\n if (this.isValidToken() && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n this.silentRefresh();\n }\n }\n\n private useFragmentTimeLogin(nonceKey: string) {\n const accessToken = this.hashFragmentParams.access_token;\n const idToken = this.hashFragmentParams.id_token;\n const sessionState = this.hashFragmentParams.session_state;\n const expiresIn = this.hashFragmentParams.expires_in;\n\n if (!sessionState) {\n throw new Error('session state not present');\n }\n\n try {\n const jwt = this.processJWTToken(idToken, nonceKey);\n if (jwt) {\n this.storeIdToken(idToken, jwt.payload.exp);\n this.storeAccessToken(accessToken, expiresIn);\n this.authentications.basicAuth.username = jwt.payload.preferred_username;\n this.saveUsername(jwt.payload.preferred_username);\n this.silentRefresh();\n return accessToken;\n }\n } catch (error) {\n throw new Error('Validation JWT error' + error);\n }\n }\n\n isPublicUrl(): boolean {\n const publicUrls = this.config.oauth2.publicUrls || [];\n\n if (Array.isArray(publicUrls)) {\n return publicUrls.length > 0 && publicUrls.some((urlPattern: string) => this.pathMatcher.match(window.location.href, urlPattern));\n }\n return false;\n }\n\n padBase64(base64data: any) {\n while (base64data.length % 4 !== 0) {\n base64data += '=';\n }\n return base64data;\n }\n\n processJWTToken(jwt: any, nonceKey: string): any {\n if (jwt) {\n const jwtArray = jwt.split('.');\n const headerBase64 = this.padBase64(jwtArray[0]);\n const headerJson = this.b64DecodeUnicode(headerBase64);\n const header = JSON.parse(headerJson);\n\n const payloadBase64 = this.padBase64(jwtArray[1]);\n const payloadJson = this.b64DecodeUnicode(payloadBase64);\n const payload = JSON.parse(payloadJson);\n\n const savedNonce = this.storage.getItem(nonceKey);\n\n if (!payload.sub) {\n throw new Error('Missing sub in JWT');\n }\n\n if (payload.nonce !== savedNonce) {\n return;\n }\n\n return {\n idToken: jwt,\n payload,\n header\n };\n }\n }\n\n b64DecodeUnicode(b64string: string) {\n const base64 = b64string.replace(/-/g, '+').replace(/_/g, '/');\n return decodeURIComponent(\n atob(base64)\n .split('')\n .map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))\n .join('')\n );\n }\n\n storeIdToken(idToken: string, exp: number) {\n this.storage.setItem('id_token', idToken);\n this.storage.setItem('id_token_expires_at', Number(exp * 1000).toString());\n this.storage.setItem('id_token_stored_at', Date.now().toString());\n }\n\n storeAccessToken(accessToken: string, expiresIn: number, refreshToken?: string) {\n this.storage.setItem('access_token', accessToken);\n\n const expiresInMilliSeconds = expiresIn * 1000;\n const now = new Date();\n const expiresAt = now.getTime() + expiresInMilliSeconds;\n\n this.storage.setItem('access_token_expires_in', expiresAt);\n this.storage.setItem('access_token_stored_at', Date.now().toString());\n this.setToken(accessToken, refreshToken);\n }\n\n saveUsername(username: string) {\n if (this.storage.supportsStorage()) {\n this.storage.setItem('USERNAME', username);\n }\n }\n\n implicitLogin() {\n if (!this.isValidToken() || !this.isValidAccessToken()) {\n this.redirectLogin();\n }\n }\n\n isValidToken(): boolean {\n let validToken = false;\n if (this.getIdToken()) {\n const expiresAt = this.storage.getItem('id_token_expires_at');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validToken = true;\n }\n }\n\n return validToken;\n }\n\n isValidAccessToken(): boolean {\n let validAccessToken = false;\n\n if (this.getAccessToken()) {\n const expiresAt = this.storage.getItem('access_token_expires_in');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validAccessToken = true;\n }\n }\n\n return validAccessToken;\n }\n\n getIdToken(): string {\n return this.storage.getItem('id_token');\n }\n\n getAccessToken(): string {\n return this.storage.getItem('access_token');\n }\n\n redirectLogin(): void {\n if (this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n const href = this.composeImplicitLoginUrl();\n window.location.href = href;\n this.emit('implicit_redirect', href);\n }\n }\n\n isRedirectionUrl() {\n return window.location.hash && window.location.hash.split('&')[0].indexOf('session_state') === -1;\n }\n\n genNonce(): string {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n for (let i = 0; i < 40; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n }\n\n composeImplicitLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('nonce', nonce);\n\n const afterLoginUriSegment = this.isRedirectionUrl() ? window.location.hash : '';\n if (afterLoginUriSegment && afterLoginUriSegment !== '/') {\n this.storage.setItem('loginFragment', afterLoginUriSegment.replace('#', '').trim());\n }\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce)\n );\n }\n\n composeIframeLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('refresh_nonce', nonce);\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectSilentIframeUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce) +\n '&prompt=none'\n );\n }\n\n hasHashCharacter(hash: string): boolean {\n return hash.indexOf('#') === 0;\n }\n\n startWithHashRoute(hash: string) {\n return hash.startsWith('#/');\n }\n\n getHashFragmentParams(externalHash: string): string {\n let hashFragmentParams = null;\n\n if (typeof window !== 'undefined') {\n let hash: string;\n\n if (!externalHash) {\n hash = decodeURIComponent(window.location.hash);\n if (!this.startWithHashRoute(hash)) {\n window.location.hash = '';\n }\n } else {\n hash = decodeURIComponent(externalHash);\n this.removeHashFromSilentIframe();\n this.destroyIframe();\n }\n\n if (this.hasHashCharacter(hash) && !this.startWithHashRoute(hash)) {\n const questionMarkPosition = hash.indexOf('?');\n\n if (questionMarkPosition > -1) {\n hash = hash.substring(questionMarkPosition + 1);\n } else {\n hash = hash.substring(1);\n }\n hashFragmentParams = this.parseQueryString(hash);\n }\n }\n return hashFragmentParams;\n }\n\n parseQueryString(queryString: string): any {\n const data: { [key: string]: any } = {};\n let pairs: string[];\n let pair: string;\n let separatorIndex: number;\n let escapedKey: string;\n let escapedValue: string;\n let key: string;\n let value: string;\n\n if (queryString !== null) {\n pairs = queryString.split('&');\n\n for (const item of pairs) {\n pair = item;\n separatorIndex = pair.indexOf('=');\n\n if (separatorIndex === -1) {\n escapedKey = pair;\n escapedValue = null;\n } else {\n escapedKey = pair.substring(0, separatorIndex);\n escapedValue = pair.substring(separatorIndex + 1);\n }\n\n key = decodeURIComponent(escapedKey);\n value = decodeURIComponent(escapedValue);\n\n if (key.startsWith('/')) {\n key = key.substring(1);\n }\n\n data[key] = value;\n }\n }\n\n return data;\n }\n\n silentRefresh(): void {\n if (typeof document === 'undefined') {\n this.pollingRefreshToken();\n return;\n }\n\n if (this.checkAccessToken) {\n this.destroyIframe();\n this.createIframe();\n this.checkAccessToken = false;\n return;\n }\n\n this.refreshTokenTimeoutIframe = setTimeout(() => {\n this.destroyIframe();\n this.createIframe();\n }, this.config.oauth2.refreshTokenTimeout);\n }\n\n removeHashFromSilentIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe') as HTMLIFrameElement;\n if (iframe?.contentWindow.location.hash) {\n iframe.contentWindow.location.hash = '';\n }\n }\n\n createIframe() {\n const iframe = document.createElement('iframe');\n iframe.id = 'silent_refresh_token_iframe';\n const loginUrl = this.composeIframeLoginUrl();\n iframe.setAttribute('src', loginUrl);\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n this.iFrameHashListener = () => {\n const silentRefreshTokenIframe: any = document.getElementById('silent_refresh_token_iframe');\n const hash = silentRefreshTokenIframe.contentWindow.location.hash;\n try {\n this.checkFragment('refresh_nonce', hash);\n } catch {\n this.logOut();\n }\n };\n\n iframe.addEventListener('load', this.iFrameHashListener);\n }\n\n destroyIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe');\n\n if (iframe) {\n iframe.removeEventListener('load', this.iFrameHashListener);\n document.body.removeChild(iframe);\n }\n }\n\n /**\n * login Alfresco API\n * @returns A promise that returns {new authentication token} if resolved and {error} if rejected.\n */\n login(username: string, password: string): Promise<any> {\n return new Promise((resolve, reject) => {\n this.grantPasswordLogin(username, password, resolve, reject);\n });\n }\n\n grantPasswordLogin(username: string, password: string, resolve: any, reject: any) {\n this.invalidateSession();\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {\n username,\n password,\n grant_type: 'password',\n client_id: this.config.oauth2.clientId,\n client_secret: this.config.oauth2.secret\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.saveUsername(username);\n this.silentRefresh();\n this.storeAccessToken(data.access_token, data.expires_in, data.refresh_token);\n\n resolve(data);\n },\n (error) => {\n if ((error.error && error.error.status === 401) || error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n pollingRefreshToken() {\n this.refreshTokenIntervalPolling = setInterval(async () => {\n try {\n await this.refreshToken();\n } catch {\n /* continue regardless of error */\n }\n }, this.config.oauth2.refreshTokenTimeout);\n\n this.refreshTokenIntervalPolling.unref();\n }\n\n /**\n * Refresh the Token\n * @returns promise of void\n */\n refreshToken(): Promise<any> {\n const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId + ':' + this.config.oauth2.secret);\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Cache-Control': 'no-cache',\n Authorization: auth\n };\n const formParams = {\n grant_type: 'refresh_token',\n refresh_token: this.authentications.oauth2.refreshToken\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = new Promise((resolve, reject) => {\n this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.setToken(data.access_token, data.refresh_token);\n resolve(data);\n },\n (error) => {\n if (error.error && error.error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n });\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n universalBtoa(stringToConvert: string) {\n try {\n return btoa(stringToConvert);\n } catch {\n return Buffer.from(stringToConvert).toString('base64');\n }\n }\n\n /**\n * Set the current Token\n */\n setToken(token: string, refreshToken: string) {\n this.authentications.oauth2.accessToken = token;\n this.authentications.oauth2.refreshToken = refreshToken;\n this.authentications.basicAuth.password = null;\n this.token = token;\n\n if (token) {\n this.emit('token_issued');\n this.emit('logged-in');\n }\n }\n\n /**\n * Get the current Token\n * @returns token value\n */\n getToken(): string {\n return this.token;\n }\n\n /**\n * return the Authentication\n * @returns authentications\n */\n getAuthentication(): Authentication {\n return this.authentications;\n }\n\n /**\n * Change the Host\n */\n changeHost(host: string) {\n this.config.hostOauth2 = host;\n }\n\n /**\n * If the client is logged in return true\n * @returns is logged in\n */\n isLoggedIn(): boolean {\n return !!this.authentications.oauth2.accessToken;\n }\n\n /**\n * Logout\n */\n async logOut() {\n this.checkAccessToken = true;\n\n const id_token = this.getIdToken();\n\n this.invalidateSession();\n this.setToken(null, null);\n\n const separation = this.discovery.logoutUrl.indexOf('?') > -1 ? '&' : '?';\n const redirectLogout = this.config.oauth2.redirectUriLogout || this.config.oauth2.redirectUri;\n const logoutUrl =\n this.discovery.logoutUrl +\n separation +\n 'post_logout_redirect_uri=' +\n encodeURIComponent(redirectLogout) +\n '&id_token_hint=' +\n encodeURIComponent(id_token);\n\n if (id_token != null && this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n window.location.href = logoutUrl;\n }\n }\n\n invalidateSession() {\n clearTimeout(this.refreshTokenTimeoutIframe);\n clearInterval(this.refreshTokenIntervalPolling);\n\n this.storage.removeItem('access_token');\n this.storage.removeItem('access_token_expires_in');\n this.storage.removeItem('access_token_stored_at');\n\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token_claims_obj');\n this.storage.removeItem('id_token_expires_at');\n this.storage.removeItem('id_token_stored_at');\n\n this.storage.removeItem('nonce');\n }\n\n exchangeTicketListener(alfrescoApi: AlfrescoApi) {\n this.on('token_issued', async () => {\n const authContentApi: AuthenticationApi = new AuthenticationApi(alfrescoApi);\n // Legacy stuff, needs deprecation, can not be more specific here because of circular dependency\n (authContentApi.apiClient as unknown as any).authentications = this.authentications;\n try {\n const ticketEntry = await authContentApi.getTicket();\n this.config.ticketEcm = ticketEntry.entry.id;\n this.emit('ticket_exchanged');\n } catch {\n // continue regardless of error\n }\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"oauth2Auth.js","sourceRoot":"","sources":["oauth2Auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAepD,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAiC7C,YAAY,MAAyB,EAAE,WAAwB,EAAE,UAAuB;QACpF,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QA1BzB,qBAAgB,GAAG,IAAI,CAAC;QAIhC,cAAS,GAKL;YACA,QAAQ,EAAE,SAAS;YACnB,SAAS,EAAE,SAAS;YACpB,aAAa,EAAE,SAAS;YACxB,gBAAgB,EAAE,SAAS;SAC9B,CAAC;QAEF,oBAAe,GAAmB;YAC9B,MAAM,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;YAC3B,IAAI,EAAE,QAAQ;YACd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CAAC,OAAO,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;QAElD,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;QAE9C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,sBAAsB,CAAC,WAAwB;QAC3C,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,GAAS,EAAE;YAC/B,MAAM,cAAc,GAAsB,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC;YAE5E,cAAc,CAAC,SAA4B,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;YACpF,IAAI,CAAC;gBACD,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,SAAS,EAAE,CAAC;gBACrD,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC7C,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAClC,CAAC;YAAC,WAAM,CAAC;YAET,CAAC;QACL,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;;AAntBe,oCAAyB,GAAG,+BAA+B,AAAlC,CAAmC;AAC5D,4BAAiB,GAAG,gCAAgC,AAAnC,CAAoC;AACrD,qCAA0B,GAAG,mCAAmC,AAAtC,CAAuC;AACjE,6BAAkB,GAAG,iCAAiC,AAApC,CAAqC","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EventEmitter } from 'eventemitter3';\nimport { AlfrescoApiClient } from '../alfrescoApiClient';\nimport { AlfrescoApiConfig } from '../alfrescoApiConfig';\nimport { Authentication } from './authentication';\nimport { AuthenticationApi } from '../api/auth-rest-api';\nimport { AlfrescoApi } from '../alfrescoApi';\nimport { Storage } from '../storage';\nimport { HttpClient } from '../api-clients/http-client.interface';\nimport { PathMatcher } from '../utils/path-matcher';\n\ndeclare const Buffer: any;\n\ndeclare let window: Window;\n\ninterface Userinfo {\n name: string;\n given_name?: string;\n family_name?: string;\n preferred_username?: string;\n email?: string;\n picture?: string;\n}\n\nexport class Oauth2Auth extends AlfrescoApiClient {\n static readonly DEFAULT_AUTHORIZATION_URL = '/protocol/openid-connect/auth';\n static readonly DEFAULT_TOKEN_URL = '/protocol/openid-connect/token';\n static readonly DEFAULT_USER_INFO_ENDPOINT = '/protocol/openid-connect/userinfo';\n static readonly DEFAULT_LOGOUT_URL = '/protocol/openid-connect/logout';\n\n private refreshTokenIntervalPolling: any;\n private refreshTokenTimeoutIframe: any;\n private checkAccessToken = true;\n\n hashFragmentParams: any;\n token: string;\n discovery: {\n loginUrl?: string;\n logoutUrl?: string;\n tokenEndpoint?: string;\n userinfoEndpoint?: string;\n } = {\n loginUrl: undefined,\n logoutUrl: undefined,\n tokenEndpoint: undefined,\n userinfoEndpoint: undefined\n };\n\n authentications: Authentication = {\n oauth2: { accessToken: '' },\n type: 'oauth2',\n basicAuth: {}\n };\n\n iFrameHashListener: any;\n pathMatcher = new PathMatcher();\n\n constructor(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi, httpClient?: HttpClient) {\n super(undefined, httpClient);\n this.storage = Storage.getInstance();\n\n this.className = 'Oauth2Auth';\n\n if (config) {\n this.setConfig(config, alfrescoApi);\n }\n }\n\n setConfig(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi) {\n this.config = config;\n this.storage.setDomainPrefix(config.domainPrefix);\n\n if (this.config.oauth2) {\n if (this.config.oauth2.host === undefined || this.config.oauth2.host === null) {\n throw new Error('Missing the required oauth2 host parameter');\n }\n\n if (this.config.oauth2.clientId === undefined || this.config.oauth2.clientId === null) {\n throw new Error('Missing the required oauth2 clientId parameter');\n }\n\n if (this.config.oauth2.scope === undefined || this.config.oauth2.scope === null) {\n throw new Error('Missing the required oauth2 scope parameter');\n }\n\n if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) {\n throw new Error('Missing redirectUri required parameter');\n }\n\n if (!this.config.oauth2.refreshTokenTimeout) {\n this.config.oauth2.refreshTokenTimeout = 300000;\n }\n\n if (!this.config.oauth2.redirectSilentIframeUri) {\n let context = '';\n if (typeof window !== 'undefined') {\n context = window.location.origin;\n }\n this.config.oauth2.redirectSilentIframeUri = context + '/assets/silent-refresh.html';\n }\n\n this.basePath = this.config.oauth2.host; //Auth Call\n\n this.host = this.config.oauth2.host;\n\n this.discoveryUrls();\n\n if (this.hasContentProvider()) {\n this.exchangeTicketListener(alfrescoApi);\n }\n\n this.initOauth();\n }\n }\n\n initOauth() {\n if (!this.config.oauth2.implicitFlow && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n }\n\n if (this.config.oauth2.implicitFlow) {\n this.checkFragment('nonce');\n }\n }\n\n discoveryUrls() {\n this.discovery.loginUrl = this.config.oauth2.authorizationUrl || this.host + Oauth2Auth.DEFAULT_AUTHORIZATION_URL;\n this.discovery.logoutUrl = this.config.oauth2.logoutUrl || this.host + Oauth2Auth.DEFAULT_LOGOUT_URL;\n this.discovery.tokenEndpoint = this.config.oauth2.tokenUrl || this.host + Oauth2Auth.DEFAULT_TOKEN_URL;\n this.discovery.userinfoEndpoint = this.config.oauth2.userinfoEndpoint || this.host + Oauth2Auth.DEFAULT_USER_INFO_ENDPOINT;\n }\n\n getProfile(): Promise<Userinfo> {\n const postBody = {};\n const pathParams = {};\n const queryParams = {};\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {};\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n return this.callCustomApi(\n this.discovery.userinfoEndpoint,\n 'GET',\n pathParams,\n queryParams,\n headerParams,\n formParams,\n postBody,\n contentTypes,\n accepts\n );\n }\n\n hasContentProvider(): boolean {\n return this.config.provider === 'ECM' || this.config.provider === 'ALL';\n }\n\n checkFragment(nonceKey?: string, externalHash?: any): any {\n // jshint ignore:line\n this.hashFragmentParams = this.getHashFragmentParams(externalHash);\n\n if (this.hashFragmentParams && this.hashFragmentParams.error === undefined) {\n this.useFragmentTimeLogin(nonceKey);\n } else {\n this.refreshBrowserLogin();\n }\n }\n\n private refreshBrowserLogin() {\n if (this.config.oauth2.silentLogin && !this.isPublicUrl()) {\n this.implicitLogin();\n }\n\n if (this.isValidToken() && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n this.silentRefresh();\n }\n }\n\n private useFragmentTimeLogin(nonceKey: string) {\n const accessToken = this.hashFragmentParams.access_token;\n const idToken = this.hashFragmentParams.id_token;\n const sessionState = this.hashFragmentParams.session_state;\n const expiresIn = this.hashFragmentParams.expires_in;\n\n if (!sessionState) {\n throw new Error('session state not present');\n }\n\n try {\n const jwt = this.processJWTToken(idToken, nonceKey);\n if (jwt) {\n this.storeIdToken(idToken, jwt.payload.exp);\n this.storeAccessToken(accessToken, expiresIn);\n this.authentications.basicAuth.username = jwt.payload.preferred_username;\n this.saveUsername(jwt.payload.preferred_username);\n this.silentRefresh();\n return accessToken;\n }\n } catch (error) {\n throw new Error('Validation JWT error' + error);\n }\n }\n\n isPublicUrl(): boolean {\n const publicUrls = this.config.oauth2.publicUrls || [];\n\n if (Array.isArray(publicUrls)) {\n return publicUrls.length > 0 && publicUrls.some((urlPattern: string) => this.pathMatcher.match(window.location.href, urlPattern));\n }\n return false;\n }\n\n padBase64(base64data: any) {\n while (base64data.length % 4 !== 0) {\n base64data += '=';\n }\n return base64data;\n }\n\n processJWTToken(jwt: any, nonceKey: string): any {\n if (jwt) {\n const jwtArray = jwt.split('.');\n const headerBase64 = this.padBase64(jwtArray[0]);\n const headerJson = this.b64DecodeUnicode(headerBase64);\n const header = JSON.parse(headerJson);\n\n const payloadBase64 = this.padBase64(jwtArray[1]);\n const payloadJson = this.b64DecodeUnicode(payloadBase64);\n const payload = JSON.parse(payloadJson);\n\n const savedNonce = this.storage.getItem(nonceKey);\n\n if (!payload.sub) {\n throw new Error('Missing sub in JWT');\n }\n\n if (payload.nonce !== savedNonce) {\n return;\n }\n\n return {\n idToken: jwt,\n payload,\n header\n };\n }\n }\n\n b64DecodeUnicode(b64string: string) {\n const base64 = b64string.replace(/-/g, '+').replace(/_/g, '/');\n return decodeURIComponent(\n atob(base64)\n .split('')\n .map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))\n .join('')\n );\n }\n\n storeIdToken(idToken: string, exp: number) {\n this.storage.setItem('id_token', idToken);\n this.storage.setItem('id_token_expires_at', Number(exp * 1000).toString());\n this.storage.setItem('id_token_stored_at', Date.now().toString());\n }\n\n storeAccessToken(accessToken: string, expiresIn: number, refreshToken?: string) {\n this.storage.setItem('access_token', accessToken);\n\n const expiresInMilliSeconds = expiresIn * 1000;\n const now = new Date();\n const expiresAt = now.getTime() + expiresInMilliSeconds;\n\n this.storage.setItem('access_token_expires_in', expiresAt);\n this.storage.setItem('access_token_stored_at', Date.now().toString());\n this.setToken(accessToken, refreshToken);\n }\n\n saveUsername(username: string) {\n if (this.storage.supportsStorage()) {\n this.storage.setItem('USERNAME', username);\n }\n }\n\n implicitLogin() {\n if (!this.isValidToken() || !this.isValidAccessToken()) {\n this.redirectLogin();\n }\n }\n\n isValidToken(): boolean {\n let validToken = false;\n if (this.getIdToken()) {\n const expiresAt = this.storage.getItem('id_token_expires_at');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validToken = true;\n }\n }\n\n return validToken;\n }\n\n isValidAccessToken(): boolean {\n let validAccessToken = false;\n\n if (this.getAccessToken()) {\n const expiresAt = this.storage.getItem('access_token_expires_in');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validAccessToken = true;\n }\n }\n\n return validAccessToken;\n }\n\n getIdToken(): string {\n return this.storage.getItem('id_token');\n }\n\n getAccessToken(): string {\n return this.storage.getItem('access_token');\n }\n\n redirectLogin(): void {\n if (this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n const href = this.composeImplicitLoginUrl();\n window.location.href = href;\n this.emit('implicit_redirect', href);\n }\n }\n\n isRedirectionUrl() {\n return window.location.hash && window.location.hash.split('&')[0].indexOf('session_state') === -1;\n }\n\n genNonce(): string {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n for (let i = 0; i < 40; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n }\n\n composeImplicitLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('nonce', nonce);\n\n const afterLoginUriSegment = this.isRedirectionUrl() ? window.location.hash : '';\n if (afterLoginUriSegment && afterLoginUriSegment !== '/') {\n this.storage.setItem('loginFragment', afterLoginUriSegment.replace('#', '').trim());\n }\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce)\n );\n }\n\n composeIframeLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('refresh_nonce', nonce);\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectSilentIframeUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce) +\n '&prompt=none'\n );\n }\n\n hasHashCharacter(hash: string): boolean {\n return hash.indexOf('#') === 0;\n }\n\n startWithHashRoute(hash: string) {\n return hash.startsWith('#/');\n }\n\n getHashFragmentParams(externalHash: string): string {\n let hashFragmentParams = null;\n\n if (typeof window !== 'undefined') {\n let hash: string;\n\n if (!externalHash) {\n hash = decodeURIComponent(window.location.hash);\n if (!this.startWithHashRoute(hash)) {\n window.location.hash = '';\n }\n } else {\n hash = decodeURIComponent(externalHash);\n this.removeHashFromSilentIframe();\n this.destroyIframe();\n }\n\n if (this.hasHashCharacter(hash) && !this.startWithHashRoute(hash)) {\n const questionMarkPosition = hash.indexOf('?');\n\n if (questionMarkPosition > -1) {\n hash = hash.substring(questionMarkPosition + 1);\n } else {\n hash = hash.substring(1);\n }\n hashFragmentParams = this.parseQueryString(hash);\n }\n }\n return hashFragmentParams;\n }\n\n parseQueryString(queryString: string): any {\n const data: { [key: string]: any } = {};\n let pairs: string[];\n let pair: string;\n let separatorIndex: number;\n let escapedKey: string;\n let escapedValue: string;\n let key: string;\n let value: string;\n\n if (queryString !== null) {\n pairs = queryString.split('&');\n\n for (const item of pairs) {\n pair = item;\n separatorIndex = pair.indexOf('=');\n\n if (separatorIndex === -1) {\n escapedKey = pair;\n escapedValue = null;\n } else {\n escapedKey = pair.substring(0, separatorIndex);\n escapedValue = pair.substring(separatorIndex + 1);\n }\n\n key = decodeURIComponent(escapedKey);\n value = decodeURIComponent(escapedValue);\n\n if (key.startsWith('/')) {\n key = key.substring(1);\n }\n\n data[key] = value;\n }\n }\n\n return data;\n }\n\n silentRefresh(): void {\n if (typeof document === 'undefined') {\n this.pollingRefreshToken();\n return;\n }\n\n if (this.checkAccessToken) {\n this.destroyIframe();\n this.createIframe();\n this.checkAccessToken = false;\n return;\n }\n\n this.refreshTokenTimeoutIframe = setTimeout(() => {\n this.destroyIframe();\n this.createIframe();\n }, this.config.oauth2.refreshTokenTimeout);\n }\n\n removeHashFromSilentIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe') as HTMLIFrameElement;\n if (iframe?.contentWindow.location.hash) {\n iframe.contentWindow.location.hash = '';\n }\n }\n\n createIframe() {\n const iframe = document.createElement('iframe');\n iframe.id = 'silent_refresh_token_iframe';\n const loginUrl = this.composeIframeLoginUrl();\n iframe.setAttribute('src', loginUrl);\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n this.iFrameHashListener = () => {\n const silentRefreshTokenIframe: any = document.getElementById('silent_refresh_token_iframe');\n const hash = silentRefreshTokenIframe.contentWindow.location.hash;\n try {\n this.checkFragment('refresh_nonce', hash);\n } catch {\n this.logOut();\n }\n };\n\n iframe.addEventListener('load', this.iFrameHashListener);\n }\n\n destroyIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe');\n\n if (iframe) {\n iframe.removeEventListener('load', this.iFrameHashListener);\n document.body.removeChild(iframe);\n }\n }\n\n /**\n * login Alfresco API\n * @returns A promise that returns {new authentication token} if resolved and {error} if rejected.\n */\n login(username: string, password: string): Promise<any> {\n return new Promise((resolve, reject) => {\n this.grantPasswordLogin(username, password, resolve, reject);\n });\n }\n\n grantPasswordLogin(username: string, password: string, resolve: any, reject: any) {\n this.invalidateSession();\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {\n username,\n password,\n grant_type: 'password',\n client_id: this.config.oauth2.clientId\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.saveUsername(username);\n this.silentRefresh();\n this.storeAccessToken(data.access_token, data.expires_in, data.refresh_token);\n\n resolve(data);\n },\n (error) => {\n if ((error.error && error.error.status === 401) || error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n pollingRefreshToken() {\n this.refreshTokenIntervalPolling = setInterval(async () => {\n try {\n await this.refreshToken();\n } catch {\n /* continue regardless of error */\n }\n }, this.config.oauth2.refreshTokenTimeout);\n\n this.refreshTokenIntervalPolling.unref();\n }\n\n /**\n * Refresh the Token\n * @returns promise of void\n */\n refreshToken(): Promise<any> {\n const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId);\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Cache-Control': 'no-cache',\n Authorization: auth\n };\n const formParams = {\n grant_type: 'refresh_token',\n refresh_token: this.authentications.oauth2.refreshToken\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = new Promise((resolve, reject) => {\n this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.setToken(data.access_token, data.refresh_token);\n resolve(data);\n },\n (error) => {\n if (error.error && error.error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n });\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n universalBtoa(stringToConvert: string) {\n try {\n return btoa(stringToConvert);\n } catch {\n return Buffer.from(stringToConvert).toString('base64');\n }\n }\n\n /**\n * Set the current Token\n */\n setToken(token: string, refreshToken: string) {\n this.authentications.oauth2.accessToken = token;\n this.authentications.oauth2.refreshToken = refreshToken;\n this.authentications.basicAuth.password = null;\n this.token = token;\n\n if (token) {\n this.emit('token_issued');\n this.emit('logged-in');\n }\n }\n\n /**\n * Get the current Token\n * @returns token value\n */\n getToken(): string {\n return this.token;\n }\n\n /**\n * return the Authentication\n * @returns authentications\n */\n getAuthentication(): Authentication {\n return this.authentications;\n }\n\n /**\n * Change the Host\n */\n changeHost(host: string) {\n this.config.hostOauth2 = host;\n }\n\n /**\n * If the client is logged in return true\n * @returns is logged in\n */\n isLoggedIn(): boolean {\n return !!this.authentications.oauth2.accessToken;\n }\n\n /**\n * Logout\n */\n async logOut() {\n this.checkAccessToken = true;\n\n const id_token = this.getIdToken();\n\n this.invalidateSession();\n this.setToken(null, null);\n\n const separation = this.discovery.logoutUrl.indexOf('?') > -1 ? '&' : '?';\n const redirectLogout = this.config.oauth2.redirectUriLogout || this.config.oauth2.redirectUri;\n const logoutUrl =\n this.discovery.logoutUrl +\n separation +\n 'post_logout_redirect_uri=' +\n encodeURIComponent(redirectLogout) +\n '&id_token_hint=' +\n encodeURIComponent(id_token);\n\n if (id_token != null && this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n window.location.href = logoutUrl;\n }\n }\n\n invalidateSession() {\n clearTimeout(this.refreshTokenTimeoutIframe);\n clearInterval(this.refreshTokenIntervalPolling);\n\n this.storage.removeItem('access_token');\n this.storage.removeItem('access_token_expires_in');\n this.storage.removeItem('access_token_stored_at');\n\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token_claims_obj');\n this.storage.removeItem('id_token_expires_at');\n this.storage.removeItem('id_token_stored_at');\n\n this.storage.removeItem('nonce');\n }\n\n exchangeTicketListener(alfrescoApi: AlfrescoApi) {\n this.on('token_issued', async () => {\n const authContentApi: AuthenticationApi = new AuthenticationApi(alfrescoApi);\n // Legacy stuff, needs deprecation, can not be more specific here because of circular dependency\n (authContentApi.apiClient as unknown as any).authentications = this.authentications;\n try {\n const ticketEntry = await authContentApi.getTicket();\n this.config.ticketEcm = ticketEntry.entry.id;\n this.emit('ticket_exchanged');\n } catch {\n // continue regardless of error\n }\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2Config.js","sourceRoot":"","sources":["oauth2Config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Oauth2Config {\n clientId: string;\n
|
|
1
|
+
{"version":3,"file":"oauth2Config.js","sourceRoot":"","sources":["oauth2Config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Oauth2Config {\n clientId: string;\n host: string;\n authorizationUrl?: string;\n tokenUrl?: string;\n userinfoEndpoint?: string;\n logoutUrl?: string;\n scope: string;\n implicitFlow?: boolean;\n redirectUri: string;\n refreshTokenTimeout?: number;\n silentLogin?: boolean;\n redirectUriLogout?: string;\n redirectSilentIframeUri?: string;\n publicUrls?: string[];\n}\n"]}
|
package/esm5/package.json
CHANGED
|
@@ -55,9 +55,6 @@ export class Oauth2Auth extends AlfrescoApiClient {
|
|
|
55
55
|
if (this.config.oauth2.scope === undefined || this.config.oauth2.scope === null) {
|
|
56
56
|
throw new Error('Missing the required oauth2 scope parameter');
|
|
57
57
|
}
|
|
58
|
-
if (this.config.oauth2.secret === undefined || this.config.oauth2.secret === null) {
|
|
59
|
-
this.config.oauth2.secret = '';
|
|
60
|
-
}
|
|
61
58
|
if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) {
|
|
62
59
|
throw new Error('Missing redirectUri required parameter');
|
|
63
60
|
}
|
|
@@ -432,8 +429,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
|
|
|
432
429
|
username,
|
|
433
430
|
password,
|
|
434
431
|
grant_type: 'password',
|
|
435
|
-
client_id: this.config.oauth2.clientId
|
|
436
|
-
client_secret: this.config.oauth2.secret
|
|
432
|
+
client_id: this.config.oauth2.clientId
|
|
437
433
|
};
|
|
438
434
|
const contentTypes = ['application/x-www-form-urlencoded'];
|
|
439
435
|
const accepts = ['application/json'];
|
|
@@ -462,7 +458,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
|
|
|
462
458
|
this.refreshTokenIntervalPolling.unref();
|
|
463
459
|
}
|
|
464
460
|
refreshToken() {
|
|
465
|
-
const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId
|
|
461
|
+
const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId);
|
|
466
462
|
const headerParams = {
|
|
467
463
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
468
464
|
'Cache-Control': 'no-cache',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2Auth.js","sourceRoot":"","sources":["oauth2Auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,OAAO,EAAE,YAAY,E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AAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;QAE9C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,sBAAsB,CAAC,WAAwB;QAC3C,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,GAAS,EAAE;YAC/B,MAAM,cAAc,GAAsB,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC;YAE5E,cAAc,CAAC,SAA4B,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;YACpF,IAAI,CAAC;gBACD,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,SAAS,EAAE,CAAC;gBACrD,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC7C,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAClC,CAAC;YAAC,WAAM,CAAC;YAET,CAAC;QACL,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;;AAxtBe,oCAAyB,GAAG,+BAA+B,AAAlC,CAAmC;AAC5D,4BAAiB,GAAG,gCAAgC,AAAnC,CAAoC;AACrD,qCAA0B,GAAG,mCAAmC,AAAtC,CAAuC;AACjE,6BAAkB,GAAG,iCAAiC,AAApC,CAAqC","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EventEmitter } from 'eventemitter3';\nimport { AlfrescoApiClient } from '../alfrescoApiClient';\nimport { AlfrescoApiConfig } from '../alfrescoApiConfig';\nimport { Authentication } from './authentication';\nimport { AuthenticationApi } from '../api/auth-rest-api';\nimport { AlfrescoApi } from '../alfrescoApi';\nimport { Storage } from '../storage';\nimport { HttpClient } from '../api-clients/http-client.interface';\nimport { PathMatcher } from '../utils/path-matcher';\n\ndeclare const Buffer: any;\n\ndeclare let window: Window;\n\ninterface Userinfo {\n name: string;\n given_name?: string;\n family_name?: string;\n preferred_username?: string;\n email?: string;\n picture?: string;\n}\n\nexport class Oauth2Auth extends AlfrescoApiClient {\n static readonly DEFAULT_AUTHORIZATION_URL = '/protocol/openid-connect/auth';\n static readonly DEFAULT_TOKEN_URL = '/protocol/openid-connect/token';\n static readonly DEFAULT_USER_INFO_ENDPOINT = '/protocol/openid-connect/userinfo';\n static readonly DEFAULT_LOGOUT_URL = '/protocol/openid-connect/logout';\n\n private refreshTokenIntervalPolling: any;\n private refreshTokenTimeoutIframe: any;\n private checkAccessToken = true;\n\n hashFragmentParams: any;\n token: string;\n discovery: {\n loginUrl?: string;\n logoutUrl?: string;\n tokenEndpoint?: string;\n userinfoEndpoint?: string;\n } = {\n loginUrl: undefined,\n logoutUrl: undefined,\n tokenEndpoint: undefined,\n userinfoEndpoint: undefined\n };\n\n authentications: Authentication = {\n oauth2: { accessToken: '' },\n type: 'oauth2',\n basicAuth: {}\n };\n\n iFrameHashListener: any;\n pathMatcher = new PathMatcher();\n\n constructor(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi, httpClient?: HttpClient) {\n super(undefined, httpClient);\n this.storage = Storage.getInstance();\n\n this.className = 'Oauth2Auth';\n\n if (config) {\n this.setConfig(config, alfrescoApi);\n }\n }\n\n setConfig(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi) {\n this.config = config;\n this.storage.setDomainPrefix(config.domainPrefix);\n\n if (this.config.oauth2) {\n if (this.config.oauth2.host === undefined || this.config.oauth2.host === null) {\n throw new Error('Missing the required oauth2 host parameter');\n }\n\n if (this.config.oauth2.clientId === undefined || this.config.oauth2.clientId === null) {\n throw new Error('Missing the required oauth2 clientId parameter');\n }\n\n if (this.config.oauth2.scope === undefined || this.config.oauth2.scope === null) {\n throw new Error('Missing the required oauth2 scope parameter');\n }\n\n if (this.config.oauth2.secret === undefined || this.config.oauth2.secret === null) {\n this.config.oauth2.secret = '';\n }\n\n if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) {\n throw new Error('Missing redirectUri required parameter');\n }\n\n if (!this.config.oauth2.refreshTokenTimeout) {\n this.config.oauth2.refreshTokenTimeout = 300000;\n }\n\n if (!this.config.oauth2.redirectSilentIframeUri) {\n let context = '';\n if (typeof window !== 'undefined') {\n context = window.location.origin;\n }\n this.config.oauth2.redirectSilentIframeUri = context + '/assets/silent-refresh.html';\n }\n\n this.basePath = this.config.oauth2.host; //Auth Call\n\n this.host = this.config.oauth2.host;\n\n this.discoveryUrls();\n\n if (this.hasContentProvider()) {\n this.exchangeTicketListener(alfrescoApi);\n }\n\n this.initOauth();\n }\n }\n\n initOauth() {\n if (!this.config.oauth2.implicitFlow && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n }\n\n if (this.config.oauth2.implicitFlow) {\n this.checkFragment('nonce');\n }\n }\n\n discoveryUrls() {\n this.discovery.loginUrl = this.config.oauth2.authorizationUrl || this.host + Oauth2Auth.DEFAULT_AUTHORIZATION_URL;\n this.discovery.logoutUrl = this.config.oauth2.logoutUrl || this.host + Oauth2Auth.DEFAULT_LOGOUT_URL;\n this.discovery.tokenEndpoint = this.config.oauth2.tokenUrl || this.host + Oauth2Auth.DEFAULT_TOKEN_URL;\n this.discovery.userinfoEndpoint = this.config.oauth2.userinfoEndpoint || this.host + Oauth2Auth.DEFAULT_USER_INFO_ENDPOINT;\n }\n\n getProfile(): Promise<Userinfo> {\n const postBody = {};\n const pathParams = {};\n const queryParams = {};\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {};\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n return this.callCustomApi(\n this.discovery.userinfoEndpoint,\n 'GET',\n pathParams,\n queryParams,\n headerParams,\n formParams,\n postBody,\n contentTypes,\n accepts\n );\n }\n\n hasContentProvider(): boolean {\n return this.config.provider === 'ECM' || this.config.provider === 'ALL';\n }\n\n checkFragment(nonceKey?: string, externalHash?: any): any {\n // jshint ignore:line\n this.hashFragmentParams = this.getHashFragmentParams(externalHash);\n\n if (this.hashFragmentParams && this.hashFragmentParams.error === undefined) {\n this.useFragmentTimeLogin(nonceKey);\n } else {\n this.refreshBrowserLogin();\n }\n }\n\n private refreshBrowserLogin() {\n if (this.config.oauth2.silentLogin && !this.isPublicUrl()) {\n this.implicitLogin();\n }\n\n if (this.isValidToken() && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n this.silentRefresh();\n }\n }\n\n private useFragmentTimeLogin(nonceKey: string) {\n const accessToken = this.hashFragmentParams.access_token;\n const idToken = this.hashFragmentParams.id_token;\n const sessionState = this.hashFragmentParams.session_state;\n const expiresIn = this.hashFragmentParams.expires_in;\n\n if (!sessionState) {\n throw new Error('session state not present');\n }\n\n try {\n const jwt = this.processJWTToken(idToken, nonceKey);\n if (jwt) {\n this.storeIdToken(idToken, jwt.payload.exp);\n this.storeAccessToken(accessToken, expiresIn);\n this.authentications.basicAuth.username = jwt.payload.preferred_username;\n this.saveUsername(jwt.payload.preferred_username);\n this.silentRefresh();\n return accessToken;\n }\n } catch (error) {\n throw new Error('Validation JWT error' + error);\n }\n }\n\n isPublicUrl(): boolean {\n const publicUrls = this.config.oauth2.publicUrls || [];\n\n if (Array.isArray(publicUrls)) {\n return publicUrls.length > 0 && publicUrls.some((urlPattern: string) => this.pathMatcher.match(window.location.href, urlPattern));\n }\n return false;\n }\n\n padBase64(base64data: any) {\n while (base64data.length % 4 !== 0) {\n base64data += '=';\n }\n return base64data;\n }\n\n processJWTToken(jwt: any, nonceKey: string): any {\n if (jwt) {\n const jwtArray = jwt.split('.');\n const headerBase64 = this.padBase64(jwtArray[0]);\n const headerJson = this.b64DecodeUnicode(headerBase64);\n const header = JSON.parse(headerJson);\n\n const payloadBase64 = this.padBase64(jwtArray[1]);\n const payloadJson = this.b64DecodeUnicode(payloadBase64);\n const payload = JSON.parse(payloadJson);\n\n const savedNonce = this.storage.getItem(nonceKey);\n\n if (!payload.sub) {\n throw new Error('Missing sub in JWT');\n }\n\n if (payload.nonce !== savedNonce) {\n return;\n }\n\n return {\n idToken: jwt,\n payload,\n header\n };\n }\n }\n\n b64DecodeUnicode(b64string: string) {\n const base64 = b64string.replace(/-/g, '+').replace(/_/g, '/');\n return decodeURIComponent(\n atob(base64)\n .split('')\n .map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))\n .join('')\n );\n }\n\n storeIdToken(idToken: string, exp: number) {\n this.storage.setItem('id_token', idToken);\n this.storage.setItem('id_token_expires_at', Number(exp * 1000).toString());\n this.storage.setItem('id_token_stored_at', Date.now().toString());\n }\n\n storeAccessToken(accessToken: string, expiresIn: number, refreshToken?: string) {\n this.storage.setItem('access_token', accessToken);\n\n const expiresInMilliSeconds = expiresIn * 1000;\n const now = new Date();\n const expiresAt = now.getTime() + expiresInMilliSeconds;\n\n this.storage.setItem('access_token_expires_in', expiresAt);\n this.storage.setItem('access_token_stored_at', Date.now().toString());\n this.setToken(accessToken, refreshToken);\n }\n\n saveUsername(username: string) {\n if (this.storage.supportsStorage()) {\n this.storage.setItem('USERNAME', username);\n }\n }\n\n implicitLogin() {\n if (!this.isValidToken() || !this.isValidAccessToken()) {\n this.redirectLogin();\n }\n }\n\n isValidToken(): boolean {\n let validToken = false;\n if (this.getIdToken()) {\n const expiresAt = this.storage.getItem('id_token_expires_at');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validToken = true;\n }\n }\n\n return validToken;\n }\n\n isValidAccessToken(): boolean {\n let validAccessToken = false;\n\n if (this.getAccessToken()) {\n const expiresAt = this.storage.getItem('access_token_expires_in');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validAccessToken = true;\n }\n }\n\n return validAccessToken;\n }\n\n getIdToken(): string {\n return this.storage.getItem('id_token');\n }\n\n getAccessToken(): string {\n return this.storage.getItem('access_token');\n }\n\n redirectLogin(): void {\n if (this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n const href = this.composeImplicitLoginUrl();\n window.location.href = href;\n this.emit('implicit_redirect', href);\n }\n }\n\n isRedirectionUrl() {\n return window.location.hash && window.location.hash.split('&')[0].indexOf('session_state') === -1;\n }\n\n genNonce(): string {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n for (let i = 0; i < 40; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n }\n\n composeImplicitLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('nonce', nonce);\n\n const afterLoginUriSegment = this.isRedirectionUrl() ? window.location.hash : '';\n if (afterLoginUriSegment && afterLoginUriSegment !== '/') {\n this.storage.setItem('loginFragment', afterLoginUriSegment.replace('#', '').trim());\n }\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce)\n );\n }\n\n composeIframeLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('refresh_nonce', nonce);\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectSilentIframeUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce) +\n '&prompt=none'\n );\n }\n\n hasHashCharacter(hash: string): boolean {\n return hash.indexOf('#') === 0;\n }\n\n startWithHashRoute(hash: string) {\n return hash.startsWith('#/');\n }\n\n getHashFragmentParams(externalHash: string): string {\n let hashFragmentParams = null;\n\n if (typeof window !== 'undefined') {\n let hash: string;\n\n if (!externalHash) {\n hash = decodeURIComponent(window.location.hash);\n if (!this.startWithHashRoute(hash)) {\n window.location.hash = '';\n }\n } else {\n hash = decodeURIComponent(externalHash);\n this.removeHashFromSilentIframe();\n this.destroyIframe();\n }\n\n if (this.hasHashCharacter(hash) && !this.startWithHashRoute(hash)) {\n const questionMarkPosition = hash.indexOf('?');\n\n if (questionMarkPosition > -1) {\n hash = hash.substring(questionMarkPosition + 1);\n } else {\n hash = hash.substring(1);\n }\n hashFragmentParams = this.parseQueryString(hash);\n }\n }\n return hashFragmentParams;\n }\n\n parseQueryString(queryString: string): any {\n const data: { [key: string]: any } = {};\n let pairs: string[];\n let pair: string;\n let separatorIndex: number;\n let escapedKey: string;\n let escapedValue: string;\n let key: string;\n let value: string;\n\n if (queryString !== null) {\n pairs = queryString.split('&');\n\n for (const item of pairs) {\n pair = item;\n separatorIndex = pair.indexOf('=');\n\n if (separatorIndex === -1) {\n escapedKey = pair;\n escapedValue = null;\n } else {\n escapedKey = pair.substring(0, separatorIndex);\n escapedValue = pair.substring(separatorIndex + 1);\n }\n\n key = decodeURIComponent(escapedKey);\n value = decodeURIComponent(escapedValue);\n\n if (key.startsWith('/')) {\n key = key.substring(1);\n }\n\n data[key] = value;\n }\n }\n\n return data;\n }\n\n silentRefresh(): void {\n if (typeof document === 'undefined') {\n this.pollingRefreshToken();\n return;\n }\n\n if (this.checkAccessToken) {\n this.destroyIframe();\n this.createIframe();\n this.checkAccessToken = false;\n return;\n }\n\n this.refreshTokenTimeoutIframe = setTimeout(() => {\n this.destroyIframe();\n this.createIframe();\n }, this.config.oauth2.refreshTokenTimeout);\n }\n\n removeHashFromSilentIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe') as HTMLIFrameElement;\n if (iframe?.contentWindow.location.hash) {\n iframe.contentWindow.location.hash = '';\n }\n }\n\n createIframe() {\n const iframe = document.createElement('iframe');\n iframe.id = 'silent_refresh_token_iframe';\n const loginUrl = this.composeIframeLoginUrl();\n iframe.setAttribute('src', loginUrl);\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n this.iFrameHashListener = () => {\n const silentRefreshTokenIframe: any = document.getElementById('silent_refresh_token_iframe');\n const hash = silentRefreshTokenIframe.contentWindow.location.hash;\n try {\n this.checkFragment('refresh_nonce', hash);\n } catch {\n this.logOut();\n }\n };\n\n iframe.addEventListener('load', this.iFrameHashListener);\n }\n\n destroyIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe');\n\n if (iframe) {\n iframe.removeEventListener('load', this.iFrameHashListener);\n document.body.removeChild(iframe);\n }\n }\n\n /**\n * login Alfresco API\n * @returns A promise that returns {new authentication token} if resolved and {error} if rejected.\n */\n login(username: string, password: string): Promise<any> {\n return new Promise((resolve, reject) => {\n this.grantPasswordLogin(username, password, resolve, reject);\n });\n }\n\n grantPasswordLogin(username: string, password: string, resolve: any, reject: any) {\n this.invalidateSession();\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {\n username,\n password,\n grant_type: 'password',\n client_id: this.config.oauth2.clientId,\n client_secret: this.config.oauth2.secret\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.saveUsername(username);\n this.silentRefresh();\n this.storeAccessToken(data.access_token, data.expires_in, data.refresh_token);\n\n resolve(data);\n },\n (error) => {\n if ((error.error && error.error.status === 401) || error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n pollingRefreshToken() {\n this.refreshTokenIntervalPolling = setInterval(async () => {\n try {\n await this.refreshToken();\n } catch {\n /* continue regardless of error */\n }\n }, this.config.oauth2.refreshTokenTimeout);\n\n this.refreshTokenIntervalPolling.unref();\n }\n\n /**\n * Refresh the Token\n * @returns promise of void\n */\n refreshToken(): Promise<any> {\n const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId + ':' + this.config.oauth2.secret);\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Cache-Control': 'no-cache',\n Authorization: auth\n };\n const formParams = {\n grant_type: 'refresh_token',\n refresh_token: this.authentications.oauth2.refreshToken\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = new Promise((resolve, reject) => {\n this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.setToken(data.access_token, data.refresh_token);\n resolve(data);\n },\n (error) => {\n if (error.error && error.error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n });\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n universalBtoa(stringToConvert: string) {\n try {\n return btoa(stringToConvert);\n } catch {\n return Buffer.from(stringToConvert).toString('base64');\n }\n }\n\n /**\n * Set the current Token\n */\n setToken(token: string, refreshToken: string) {\n this.authentications.oauth2.accessToken = token;\n this.authentications.oauth2.refreshToken = refreshToken;\n this.authentications.basicAuth.password = null;\n this.token = token;\n\n if (token) {\n this.emit('token_issued');\n this.emit('logged-in');\n }\n }\n\n /**\n * Get the current Token\n * @returns token value\n */\n getToken(): string {\n return this.token;\n }\n\n /**\n * return the Authentication\n * @returns authentications\n */\n getAuthentication(): Authentication {\n return this.authentications;\n }\n\n /**\n * Change the Host\n */\n changeHost(host: string) {\n this.config.hostOauth2 = host;\n }\n\n /**\n * If the client is logged in return true\n * @returns is logged in\n */\n isLoggedIn(): boolean {\n return !!this.authentications.oauth2.accessToken;\n }\n\n /**\n * Logout\n */\n async logOut() {\n this.checkAccessToken = true;\n\n const id_token = this.getIdToken();\n\n this.invalidateSession();\n this.setToken(null, null);\n\n const separation = this.discovery.logoutUrl.indexOf('?') > -1 ? '&' : '?';\n const redirectLogout = this.config.oauth2.redirectUriLogout || this.config.oauth2.redirectUri;\n const logoutUrl =\n this.discovery.logoutUrl +\n separation +\n 'post_logout_redirect_uri=' +\n encodeURIComponent(redirectLogout) +\n '&id_token_hint=' +\n encodeURIComponent(id_token);\n\n if (id_token != null && this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n window.location.href = logoutUrl;\n }\n }\n\n invalidateSession() {\n clearTimeout(this.refreshTokenTimeoutIframe);\n clearInterval(this.refreshTokenIntervalPolling);\n\n this.storage.removeItem('access_token');\n this.storage.removeItem('access_token_expires_in');\n this.storage.removeItem('access_token_stored_at');\n\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token_claims_obj');\n this.storage.removeItem('id_token_expires_at');\n this.storage.removeItem('id_token_stored_at');\n\n this.storage.removeItem('nonce');\n }\n\n exchangeTicketListener(alfrescoApi: AlfrescoApi) {\n this.on('token_issued', async () => {\n const authContentApi: AuthenticationApi = new AuthenticationApi(alfrescoApi);\n // Legacy stuff, needs deprecation, can not be more specific here because of circular dependency\n (authContentApi.apiClient as unknown as any).authentications = this.authentications;\n try {\n const ticketEntry = await authContentApi.getTicket();\n this.config.ticketEcm = ticketEntry.entry.id;\n this.emit('ticket_exchanged');\n } catch {\n // continue regardless of error\n }\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"o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C,cAAc,EAAE,GAAS,EAAE;YAC/B,MAAM,cAAc,GAAsB,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC;YAE5E,cAAc,CAAC,SAA4B,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;YACpF,IAAI,CAAC;gBACD,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,SAAS,EAAE,CAAC;gBACrD,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC7C,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAClC,CAAC;YAAC,WAAM,CAAC;YAET,CAAC;QACL,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;;AAntBe,oCAAyB,GAAG,+BAA+B,AAAlC,CAAmC;AAC5D,4BAAiB,GAAG,gCAAgC,AAAnC,CAAoC;AACrD,qCAA0B,GAAG,mCAAmC,AAAtC,CAAuC;AACjE,6BAAkB,GAAG,iCAAiC,AAApC,CAAqC","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EventEmitter } from 'eventemitter3';\nimport { AlfrescoApiClient } from '../alfrescoApiClient';\nimport { AlfrescoApiConfig } from '../alfrescoApiConfig';\nimport { Authentication } from './authentication';\nimport { AuthenticationApi } from '../api/auth-rest-api';\nimport { AlfrescoApi } from '../alfrescoApi';\nimport { Storage } from '../storage';\nimport { HttpClient } from '../api-clients/http-client.interface';\nimport { PathMatcher } from '../utils/path-matcher';\n\ndeclare const Buffer: any;\n\ndeclare let window: Window;\n\ninterface Userinfo {\n name: string;\n given_name?: string;\n family_name?: string;\n preferred_username?: string;\n email?: string;\n picture?: string;\n}\n\nexport class Oauth2Auth extends AlfrescoApiClient {\n static readonly DEFAULT_AUTHORIZATION_URL = '/protocol/openid-connect/auth';\n static readonly DEFAULT_TOKEN_URL = '/protocol/openid-connect/token';\n static readonly DEFAULT_USER_INFO_ENDPOINT = '/protocol/openid-connect/userinfo';\n static readonly DEFAULT_LOGOUT_URL = '/protocol/openid-connect/logout';\n\n private refreshTokenIntervalPolling: any;\n private refreshTokenTimeoutIframe: any;\n private checkAccessToken = true;\n\n hashFragmentParams: any;\n token: string;\n discovery: {\n loginUrl?: string;\n logoutUrl?: string;\n tokenEndpoint?: string;\n userinfoEndpoint?: string;\n } = {\n loginUrl: undefined,\n logoutUrl: undefined,\n tokenEndpoint: undefined,\n userinfoEndpoint: undefined\n };\n\n authentications: Authentication = {\n oauth2: { accessToken: '' },\n type: 'oauth2',\n basicAuth: {}\n };\n\n iFrameHashListener: any;\n pathMatcher = new PathMatcher();\n\n constructor(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi, httpClient?: HttpClient) {\n super(undefined, httpClient);\n this.storage = Storage.getInstance();\n\n this.className = 'Oauth2Auth';\n\n if (config) {\n this.setConfig(config, alfrescoApi);\n }\n }\n\n setConfig(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi) {\n this.config = config;\n this.storage.setDomainPrefix(config.domainPrefix);\n\n if (this.config.oauth2) {\n if (this.config.oauth2.host === undefined || this.config.oauth2.host === null) {\n throw new Error('Missing the required oauth2 host parameter');\n }\n\n if (this.config.oauth2.clientId === undefined || this.config.oauth2.clientId === null) {\n throw new Error('Missing the required oauth2 clientId parameter');\n }\n\n if (this.config.oauth2.scope === undefined || this.config.oauth2.scope === null) {\n throw new Error('Missing the required oauth2 scope parameter');\n }\n\n if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) {\n throw new Error('Missing redirectUri required parameter');\n }\n\n if (!this.config.oauth2.refreshTokenTimeout) {\n this.config.oauth2.refreshTokenTimeout = 300000;\n }\n\n if (!this.config.oauth2.redirectSilentIframeUri) {\n let context = '';\n if (typeof window !== 'undefined') {\n context = window.location.origin;\n }\n this.config.oauth2.redirectSilentIframeUri = context + '/assets/silent-refresh.html';\n }\n\n this.basePath = this.config.oauth2.host; //Auth Call\n\n this.host = this.config.oauth2.host;\n\n this.discoveryUrls();\n\n if (this.hasContentProvider()) {\n this.exchangeTicketListener(alfrescoApi);\n }\n\n this.initOauth();\n }\n }\n\n initOauth() {\n if (!this.config.oauth2.implicitFlow && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n }\n\n if (this.config.oauth2.implicitFlow) {\n this.checkFragment('nonce');\n }\n }\n\n discoveryUrls() {\n this.discovery.loginUrl = this.config.oauth2.authorizationUrl || this.host + Oauth2Auth.DEFAULT_AUTHORIZATION_URL;\n this.discovery.logoutUrl = this.config.oauth2.logoutUrl || this.host + Oauth2Auth.DEFAULT_LOGOUT_URL;\n this.discovery.tokenEndpoint = this.config.oauth2.tokenUrl || this.host + Oauth2Auth.DEFAULT_TOKEN_URL;\n this.discovery.userinfoEndpoint = this.config.oauth2.userinfoEndpoint || this.host + Oauth2Auth.DEFAULT_USER_INFO_ENDPOINT;\n }\n\n getProfile(): Promise<Userinfo> {\n const postBody = {};\n const pathParams = {};\n const queryParams = {};\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {};\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n return this.callCustomApi(\n this.discovery.userinfoEndpoint,\n 'GET',\n pathParams,\n queryParams,\n headerParams,\n formParams,\n postBody,\n contentTypes,\n accepts\n );\n }\n\n hasContentProvider(): boolean {\n return this.config.provider === 'ECM' || this.config.provider === 'ALL';\n }\n\n checkFragment(nonceKey?: string, externalHash?: any): any {\n // jshint ignore:line\n this.hashFragmentParams = this.getHashFragmentParams(externalHash);\n\n if (this.hashFragmentParams && this.hashFragmentParams.error === undefined) {\n this.useFragmentTimeLogin(nonceKey);\n } else {\n this.refreshBrowserLogin();\n }\n }\n\n private refreshBrowserLogin() {\n if (this.config.oauth2.silentLogin && !this.isPublicUrl()) {\n this.implicitLogin();\n }\n\n if (this.isValidToken() && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n this.silentRefresh();\n }\n }\n\n private useFragmentTimeLogin(nonceKey: string) {\n const accessToken = this.hashFragmentParams.access_token;\n const idToken = this.hashFragmentParams.id_token;\n const sessionState = this.hashFragmentParams.session_state;\n const expiresIn = this.hashFragmentParams.expires_in;\n\n if (!sessionState) {\n throw new Error('session state not present');\n }\n\n try {\n const jwt = this.processJWTToken(idToken, nonceKey);\n if (jwt) {\n this.storeIdToken(idToken, jwt.payload.exp);\n this.storeAccessToken(accessToken, expiresIn);\n this.authentications.basicAuth.username = jwt.payload.preferred_username;\n this.saveUsername(jwt.payload.preferred_username);\n this.silentRefresh();\n return accessToken;\n }\n } catch (error) {\n throw new Error('Validation JWT error' + error);\n }\n }\n\n isPublicUrl(): boolean {\n const publicUrls = this.config.oauth2.publicUrls || [];\n\n if (Array.isArray(publicUrls)) {\n return publicUrls.length > 0 && publicUrls.some((urlPattern: string) => this.pathMatcher.match(window.location.href, urlPattern));\n }\n return false;\n }\n\n padBase64(base64data: any) {\n while (base64data.length % 4 !== 0) {\n base64data += '=';\n }\n return base64data;\n }\n\n processJWTToken(jwt: any, nonceKey: string): any {\n if (jwt) {\n const jwtArray = jwt.split('.');\n const headerBase64 = this.padBase64(jwtArray[0]);\n const headerJson = this.b64DecodeUnicode(headerBase64);\n const header = JSON.parse(headerJson);\n\n const payloadBase64 = this.padBase64(jwtArray[1]);\n const payloadJson = this.b64DecodeUnicode(payloadBase64);\n const payload = JSON.parse(payloadJson);\n\n const savedNonce = this.storage.getItem(nonceKey);\n\n if (!payload.sub) {\n throw new Error('Missing sub in JWT');\n }\n\n if (payload.nonce !== savedNonce) {\n return;\n }\n\n return {\n idToken: jwt,\n payload,\n header\n };\n }\n }\n\n b64DecodeUnicode(b64string: string) {\n const base64 = b64string.replace(/-/g, '+').replace(/_/g, '/');\n return decodeURIComponent(\n atob(base64)\n .split('')\n .map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))\n .join('')\n );\n }\n\n storeIdToken(idToken: string, exp: number) {\n this.storage.setItem('id_token', idToken);\n this.storage.setItem('id_token_expires_at', Number(exp * 1000).toString());\n this.storage.setItem('id_token_stored_at', Date.now().toString());\n }\n\n storeAccessToken(accessToken: string, expiresIn: number, refreshToken?: string) {\n this.storage.setItem('access_token', accessToken);\n\n const expiresInMilliSeconds = expiresIn * 1000;\n const now = new Date();\n const expiresAt = now.getTime() + expiresInMilliSeconds;\n\n this.storage.setItem('access_token_expires_in', expiresAt);\n this.storage.setItem('access_token_stored_at', Date.now().toString());\n this.setToken(accessToken, refreshToken);\n }\n\n saveUsername(username: string) {\n if (this.storage.supportsStorage()) {\n this.storage.setItem('USERNAME', username);\n }\n }\n\n implicitLogin() {\n if (!this.isValidToken() || !this.isValidAccessToken()) {\n this.redirectLogin();\n }\n }\n\n isValidToken(): boolean {\n let validToken = false;\n if (this.getIdToken()) {\n const expiresAt = this.storage.getItem('id_token_expires_at');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validToken = true;\n }\n }\n\n return validToken;\n }\n\n isValidAccessToken(): boolean {\n let validAccessToken = false;\n\n if (this.getAccessToken()) {\n const expiresAt = this.storage.getItem('access_token_expires_in');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validAccessToken = true;\n }\n }\n\n return validAccessToken;\n }\n\n getIdToken(): string {\n return this.storage.getItem('id_token');\n }\n\n getAccessToken(): string {\n return this.storage.getItem('access_token');\n }\n\n redirectLogin(): void {\n if (this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n const href = this.composeImplicitLoginUrl();\n window.location.href = href;\n this.emit('implicit_redirect', href);\n }\n }\n\n isRedirectionUrl() {\n return window.location.hash && window.location.hash.split('&')[0].indexOf('session_state') === -1;\n }\n\n genNonce(): string {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n for (let i = 0; i < 40; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n }\n\n composeImplicitLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('nonce', nonce);\n\n const afterLoginUriSegment = this.isRedirectionUrl() ? window.location.hash : '';\n if (afterLoginUriSegment && afterLoginUriSegment !== '/') {\n this.storage.setItem('loginFragment', afterLoginUriSegment.replace('#', '').trim());\n }\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce)\n );\n }\n\n composeIframeLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('refresh_nonce', nonce);\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectSilentIframeUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce) +\n '&prompt=none'\n );\n }\n\n hasHashCharacter(hash: string): boolean {\n return hash.indexOf('#') === 0;\n }\n\n startWithHashRoute(hash: string) {\n return hash.startsWith('#/');\n }\n\n getHashFragmentParams(externalHash: string): string {\n let hashFragmentParams = null;\n\n if (typeof window !== 'undefined') {\n let hash: string;\n\n if (!externalHash) {\n hash = decodeURIComponent(window.location.hash);\n if (!this.startWithHashRoute(hash)) {\n window.location.hash = '';\n }\n } else {\n hash = decodeURIComponent(externalHash);\n this.removeHashFromSilentIframe();\n this.destroyIframe();\n }\n\n if (this.hasHashCharacter(hash) && !this.startWithHashRoute(hash)) {\n const questionMarkPosition = hash.indexOf('?');\n\n if (questionMarkPosition > -1) {\n hash = hash.substring(questionMarkPosition + 1);\n } else {\n hash = hash.substring(1);\n }\n hashFragmentParams = this.parseQueryString(hash);\n }\n }\n return hashFragmentParams;\n }\n\n parseQueryString(queryString: string): any {\n const data: { [key: string]: any } = {};\n let pairs: string[];\n let pair: string;\n let separatorIndex: number;\n let escapedKey: string;\n let escapedValue: string;\n let key: string;\n let value: string;\n\n if (queryString !== null) {\n pairs = queryString.split('&');\n\n for (const item of pairs) {\n pair = item;\n separatorIndex = pair.indexOf('=');\n\n if (separatorIndex === -1) {\n escapedKey = pair;\n escapedValue = null;\n } else {\n escapedKey = pair.substring(0, separatorIndex);\n escapedValue = pair.substring(separatorIndex + 1);\n }\n\n key = decodeURIComponent(escapedKey);\n value = decodeURIComponent(escapedValue);\n\n if (key.startsWith('/')) {\n key = key.substring(1);\n }\n\n data[key] = value;\n }\n }\n\n return data;\n }\n\n silentRefresh(): void {\n if (typeof document === 'undefined') {\n this.pollingRefreshToken();\n return;\n }\n\n if (this.checkAccessToken) {\n this.destroyIframe();\n this.createIframe();\n this.checkAccessToken = false;\n return;\n }\n\n this.refreshTokenTimeoutIframe = setTimeout(() => {\n this.destroyIframe();\n this.createIframe();\n }, this.config.oauth2.refreshTokenTimeout);\n }\n\n removeHashFromSilentIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe') as HTMLIFrameElement;\n if (iframe?.contentWindow.location.hash) {\n iframe.contentWindow.location.hash = '';\n }\n }\n\n createIframe() {\n const iframe = document.createElement('iframe');\n iframe.id = 'silent_refresh_token_iframe';\n const loginUrl = this.composeIframeLoginUrl();\n iframe.setAttribute('src', loginUrl);\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n this.iFrameHashListener = () => {\n const silentRefreshTokenIframe: any = document.getElementById('silent_refresh_token_iframe');\n const hash = silentRefreshTokenIframe.contentWindow.location.hash;\n try {\n this.checkFragment('refresh_nonce', hash);\n } catch {\n this.logOut();\n }\n };\n\n iframe.addEventListener('load', this.iFrameHashListener);\n }\n\n destroyIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe');\n\n if (iframe) {\n iframe.removeEventListener('load', this.iFrameHashListener);\n document.body.removeChild(iframe);\n }\n }\n\n /**\n * login Alfresco API\n * @returns A promise that returns {new authentication token} if resolved and {error} if rejected.\n */\n login(username: string, password: string): Promise<any> {\n return new Promise((resolve, reject) => {\n this.grantPasswordLogin(username, password, resolve, reject);\n });\n }\n\n grantPasswordLogin(username: string, password: string, resolve: any, reject: any) {\n this.invalidateSession();\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {\n username,\n password,\n grant_type: 'password',\n client_id: this.config.oauth2.clientId\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.saveUsername(username);\n this.silentRefresh();\n this.storeAccessToken(data.access_token, data.expires_in, data.refresh_token);\n\n resolve(data);\n },\n (error) => {\n if ((error.error && error.error.status === 401) || error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n pollingRefreshToken() {\n this.refreshTokenIntervalPolling = setInterval(async () => {\n try {\n await this.refreshToken();\n } catch {\n /* continue regardless of error */\n }\n }, this.config.oauth2.refreshTokenTimeout);\n\n this.refreshTokenIntervalPolling.unref();\n }\n\n /**\n * Refresh the Token\n * @returns promise of void\n */\n refreshToken(): Promise<any> {\n const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId);\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Cache-Control': 'no-cache',\n Authorization: auth\n };\n const formParams = {\n grant_type: 'refresh_token',\n refresh_token: this.authentications.oauth2.refreshToken\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = new Promise((resolve, reject) => {\n this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.setToken(data.access_token, data.refresh_token);\n resolve(data);\n },\n (error) => {\n if (error.error && error.error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n });\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n universalBtoa(stringToConvert: string) {\n try {\n return btoa(stringToConvert);\n } catch {\n return Buffer.from(stringToConvert).toString('base64');\n }\n }\n\n /**\n * Set the current Token\n */\n setToken(token: string, refreshToken: string) {\n this.authentications.oauth2.accessToken = token;\n this.authentications.oauth2.refreshToken = refreshToken;\n this.authentications.basicAuth.password = null;\n this.token = token;\n\n if (token) {\n this.emit('token_issued');\n this.emit('logged-in');\n }\n }\n\n /**\n * Get the current Token\n * @returns token value\n */\n getToken(): string {\n return this.token;\n }\n\n /**\n * return the Authentication\n * @returns authentications\n */\n getAuthentication(): Authentication {\n return this.authentications;\n }\n\n /**\n * Change the Host\n */\n changeHost(host: string) {\n this.config.hostOauth2 = host;\n }\n\n /**\n * If the client is logged in return true\n * @returns is logged in\n */\n isLoggedIn(): boolean {\n return !!this.authentications.oauth2.accessToken;\n }\n\n /**\n * Logout\n */\n async logOut() {\n this.checkAccessToken = true;\n\n const id_token = this.getIdToken();\n\n this.invalidateSession();\n this.setToken(null, null);\n\n const separation = this.discovery.logoutUrl.indexOf('?') > -1 ? '&' : '?';\n const redirectLogout = this.config.oauth2.redirectUriLogout || this.config.oauth2.redirectUri;\n const logoutUrl =\n this.discovery.logoutUrl +\n separation +\n 'post_logout_redirect_uri=' +\n encodeURIComponent(redirectLogout) +\n '&id_token_hint=' +\n encodeURIComponent(id_token);\n\n if (id_token != null && this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n window.location.href = logoutUrl;\n }\n }\n\n invalidateSession() {\n clearTimeout(this.refreshTokenTimeoutIframe);\n clearInterval(this.refreshTokenIntervalPolling);\n\n this.storage.removeItem('access_token');\n this.storage.removeItem('access_token_expires_in');\n this.storage.removeItem('access_token_stored_at');\n\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token_claims_obj');\n this.storage.removeItem('id_token_expires_at');\n this.storage.removeItem('id_token_stored_at');\n\n this.storage.removeItem('nonce');\n }\n\n exchangeTicketListener(alfrescoApi: AlfrescoApi) {\n this.on('token_issued', async () => {\n const authContentApi: AuthenticationApi = new AuthenticationApi(alfrescoApi);\n // Legacy stuff, needs deprecation, can not be more specific here because of circular dependency\n (authContentApi.apiClient as unknown as any).authentications = this.authentications;\n try {\n const ticketEntry = await authContentApi.getTicket();\n this.config.ticketEcm = ticketEntry.entry.id;\n this.emit('ticket_exchanged');\n } catch {\n // continue regardless of error\n }\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2Config.js","sourceRoot":"","sources":["oauth2Config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Oauth2Config {\n clientId: string;\n
|
|
1
|
+
{"version":3,"file":"oauth2Config.js","sourceRoot":"","sources":["oauth2Config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Oauth2Config {\n clientId: string;\n host: string;\n authorizationUrl?: string;\n tokenUrl?: string;\n userinfoEndpoint?: string;\n logoutUrl?: string;\n scope: string;\n implicitFlow?: boolean;\n redirectUri: string;\n refreshTokenTimeout?: number;\n silentLogin?: boolean;\n redirectUriLogout?: string;\n redirectSilentIframeUri?: string;\n publicUrls?: string[];\n}\n"]}
|
package/package.json
CHANGED
|
@@ -58,9 +58,6 @@ class Oauth2Auth extends alfrescoApiClient_1.AlfrescoApiClient {
|
|
|
58
58
|
if (this.config.oauth2.scope === undefined || this.config.oauth2.scope === null) {
|
|
59
59
|
throw new Error('Missing the required oauth2 scope parameter');
|
|
60
60
|
}
|
|
61
|
-
if (this.config.oauth2.secret === undefined || this.config.oauth2.secret === null) {
|
|
62
|
-
this.config.oauth2.secret = '';
|
|
63
|
-
}
|
|
64
61
|
if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) {
|
|
65
62
|
throw new Error('Missing redirectUri required parameter');
|
|
66
63
|
}
|
|
@@ -435,8 +432,7 @@ class Oauth2Auth extends alfrescoApiClient_1.AlfrescoApiClient {
|
|
|
435
432
|
username,
|
|
436
433
|
password,
|
|
437
434
|
grant_type: 'password',
|
|
438
|
-
client_id: this.config.oauth2.clientId
|
|
439
|
-
client_secret: this.config.oauth2.secret
|
|
435
|
+
client_id: this.config.oauth2.clientId
|
|
440
436
|
};
|
|
441
437
|
const contentTypes = ['application/x-www-form-urlencoded'];
|
|
442
438
|
const accepts = ['application/json'];
|
|
@@ -465,7 +461,7 @@ class Oauth2Auth extends alfrescoApiClient_1.AlfrescoApiClient {
|
|
|
465
461
|
this.refreshTokenIntervalPolling.unref();
|
|
466
462
|
}
|
|
467
463
|
refreshToken() {
|
|
468
|
-
const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId
|
|
464
|
+
const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId);
|
|
469
465
|
const headerParams = {
|
|
470
466
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
471
467
|
'Cache-Control': 'no-cache',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2Auth.js","sourceRoot":"","sources":["oauth2Auth.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;AAEH,iDAA6C;AAC7C,4DAAyD;AAGzD,wDAAyD;AAEzD,wCAAqC;AAErC,wDAAoD;AAepD,MAAa,UAAW,SAAQ,qCAAiB;IAiC7C,YAAY,MAAyB,EAAE,WAAwB,EAAE,UAAuB;QACpF,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QA1BzB,qBAAgB,GAAG,IAAI,CAAC;QAIhC,cAAS,GAKL;YACA,QAAQ,EAAE,SAAS;YACnB,SAAS,EAAE,SAAS;YACpB,aAAa,EAAE,SAAS;YACxB,gBAAgB,EAAE,SAAS;SAC9B,CAAC;QAEF,oBAAe,GAAmB;YAC9B,MAAM,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;YAC3B,IAAI,EAAE,QAAQ;YACd,SAAS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,CAAC;QACL,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;;AAztBL,gCA0tBC;AAztBmB,oCAAyB,GAAG,+BAA+B,AAAlC,CAAmC;AAC5D,4BAAiB,GAAG,gCAAgC,AAAnC,CAAoC;AACrD,qCAA0B,GAAG,mCAAmC,AAAtC,CAAuC;AACjE,6BAAkB,GAAG,iCAAiC,AAApC,CAAqC","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EventEmitter } from 'eventemitter3';\nimport { AlfrescoApiClient } from '../alfrescoApiClient';\nimport { AlfrescoApiConfig } from '../alfrescoApiConfig';\nimport { Authentication } from './authentication';\nimport { AuthenticationApi } from '../api/auth-rest-api';\nimport { AlfrescoApi } from '../alfrescoApi';\nimport { Storage } from '../storage';\nimport { HttpClient } from '../api-clients/http-client.interface';\nimport { PathMatcher } from '../utils/path-matcher';\n\ndeclare const Buffer: any;\n\ndeclare let window: Window;\n\ninterface Userinfo {\n name: string;\n given_name?: string;\n family_name?: string;\n preferred_username?: string;\n email?: string;\n picture?: string;\n}\n\nexport class Oauth2Auth extends AlfrescoApiClient {\n static readonly DEFAULT_AUTHORIZATION_URL = '/protocol/openid-connect/auth';\n static readonly DEFAULT_TOKEN_URL = '/protocol/openid-connect/token';\n static readonly DEFAULT_USER_INFO_ENDPOINT = '/protocol/openid-connect/userinfo';\n static readonly DEFAULT_LOGOUT_URL = '/protocol/openid-connect/logout';\n\n private refreshTokenIntervalPolling: any;\n private refreshTokenTimeoutIframe: any;\n private checkAccessToken = true;\n\n hashFragmentParams: any;\n token: string;\n discovery: {\n loginUrl?: string;\n logoutUrl?: string;\n tokenEndpoint?: string;\n userinfoEndpoint?: string;\n } = {\n loginUrl: undefined,\n logoutUrl: undefined,\n tokenEndpoint: undefined,\n userinfoEndpoint: undefined\n };\n\n authentications: Authentication = {\n oauth2: { accessToken: '' },\n type: 'oauth2',\n basicAuth: {}\n };\n\n iFrameHashListener: any;\n pathMatcher = new PathMatcher();\n\n constructor(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi, httpClient?: HttpClient) {\n super(undefined, httpClient);\n this.storage = Storage.getInstance();\n\n this.className = 'Oauth2Auth';\n\n if (config) {\n this.setConfig(config, alfrescoApi);\n }\n }\n\n setConfig(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi) {\n this.config = config;\n this.storage.setDomainPrefix(config.domainPrefix);\n\n if (this.config.oauth2) {\n if (this.config.oauth2.host === undefined || this.config.oauth2.host === null) {\n throw new Error('Missing the required oauth2 host parameter');\n }\n\n if (this.config.oauth2.clientId === undefined || this.config.oauth2.clientId === null) {\n throw new Error('Missing the required oauth2 clientId parameter');\n }\n\n if (this.config.oauth2.scope === undefined || this.config.oauth2.scope === null) {\n throw new Error('Missing the required oauth2 scope parameter');\n }\n\n if (this.config.oauth2.secret === undefined || this.config.oauth2.secret === null) {\n this.config.oauth2.secret = '';\n }\n\n if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) {\n throw new Error('Missing redirectUri required parameter');\n }\n\n if (!this.config.oauth2.refreshTokenTimeout) {\n this.config.oauth2.refreshTokenTimeout = 300000;\n }\n\n if (!this.config.oauth2.redirectSilentIframeUri) {\n let context = '';\n if (typeof window !== 'undefined') {\n context = window.location.origin;\n }\n this.config.oauth2.redirectSilentIframeUri = context + '/assets/silent-refresh.html';\n }\n\n this.basePath = this.config.oauth2.host; //Auth Call\n\n this.host = this.config.oauth2.host;\n\n this.discoveryUrls();\n\n if (this.hasContentProvider()) {\n this.exchangeTicketListener(alfrescoApi);\n }\n\n this.initOauth();\n }\n }\n\n initOauth() {\n if (!this.config.oauth2.implicitFlow && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n }\n\n if (this.config.oauth2.implicitFlow) {\n this.checkFragment('nonce');\n }\n }\n\n discoveryUrls() {\n this.discovery.loginUrl = this.config.oauth2.authorizationUrl || this.host + Oauth2Auth.DEFAULT_AUTHORIZATION_URL;\n this.discovery.logoutUrl = this.config.oauth2.logoutUrl || this.host + Oauth2Auth.DEFAULT_LOGOUT_URL;\n this.discovery.tokenEndpoint = this.config.oauth2.tokenUrl || this.host + Oauth2Auth.DEFAULT_TOKEN_URL;\n this.discovery.userinfoEndpoint = this.config.oauth2.userinfoEndpoint || this.host + Oauth2Auth.DEFAULT_USER_INFO_ENDPOINT;\n }\n\n getProfile(): Promise<Userinfo> {\n const postBody = {};\n const pathParams = {};\n const queryParams = {};\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {};\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n return this.callCustomApi(\n this.discovery.userinfoEndpoint,\n 'GET',\n pathParams,\n queryParams,\n headerParams,\n formParams,\n postBody,\n contentTypes,\n accepts\n );\n }\n\n hasContentProvider(): boolean {\n return this.config.provider === 'ECM' || this.config.provider === 'ALL';\n }\n\n checkFragment(nonceKey?: string, externalHash?: any): any {\n // jshint ignore:line\n this.hashFragmentParams = this.getHashFragmentParams(externalHash);\n\n if (this.hashFragmentParams && this.hashFragmentParams.error === undefined) {\n this.useFragmentTimeLogin(nonceKey);\n } else {\n this.refreshBrowserLogin();\n }\n }\n\n private refreshBrowserLogin() {\n if (this.config.oauth2.silentLogin && !this.isPublicUrl()) {\n this.implicitLogin();\n }\n\n if (this.isValidToken() && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n this.silentRefresh();\n }\n }\n\n private useFragmentTimeLogin(nonceKey: string) {\n const accessToken = this.hashFragmentParams.access_token;\n const idToken = this.hashFragmentParams.id_token;\n const sessionState = this.hashFragmentParams.session_state;\n const expiresIn = this.hashFragmentParams.expires_in;\n\n if (!sessionState) {\n throw new Error('session state not present');\n }\n\n try {\n const jwt = this.processJWTToken(idToken, nonceKey);\n if (jwt) {\n this.storeIdToken(idToken, jwt.payload.exp);\n this.storeAccessToken(accessToken, expiresIn);\n this.authentications.basicAuth.username = jwt.payload.preferred_username;\n this.saveUsername(jwt.payload.preferred_username);\n this.silentRefresh();\n return accessToken;\n }\n } catch (error) {\n throw new Error('Validation JWT error' + error);\n }\n }\n\n isPublicUrl(): boolean {\n const publicUrls = this.config.oauth2.publicUrls || [];\n\n if (Array.isArray(publicUrls)) {\n return publicUrls.length > 0 && publicUrls.some((urlPattern: string) => this.pathMatcher.match(window.location.href, urlPattern));\n }\n return false;\n }\n\n padBase64(base64data: any) {\n while (base64data.length % 4 !== 0) {\n base64data += '=';\n }\n return base64data;\n }\n\n processJWTToken(jwt: any, nonceKey: string): any {\n if (jwt) {\n const jwtArray = jwt.split('.');\n const headerBase64 = this.padBase64(jwtArray[0]);\n const headerJson = this.b64DecodeUnicode(headerBase64);\n const header = JSON.parse(headerJson);\n\n const payloadBase64 = this.padBase64(jwtArray[1]);\n const payloadJson = this.b64DecodeUnicode(payloadBase64);\n const payload = JSON.parse(payloadJson);\n\n const savedNonce = this.storage.getItem(nonceKey);\n\n if (!payload.sub) {\n throw new Error('Missing sub in JWT');\n }\n\n if (payload.nonce !== savedNonce) {\n return;\n }\n\n return {\n idToken: jwt,\n payload,\n header\n };\n }\n }\n\n b64DecodeUnicode(b64string: string) {\n const base64 = b64string.replace(/-/g, '+').replace(/_/g, '/');\n return decodeURIComponent(\n atob(base64)\n .split('')\n .map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))\n .join('')\n );\n }\n\n storeIdToken(idToken: string, exp: number) {\n this.storage.setItem('id_token', idToken);\n this.storage.setItem('id_token_expires_at', Number(exp * 1000).toString());\n this.storage.setItem('id_token_stored_at', Date.now().toString());\n }\n\n storeAccessToken(accessToken: string, expiresIn: number, refreshToken?: string) {\n this.storage.setItem('access_token', accessToken);\n\n const expiresInMilliSeconds = expiresIn * 1000;\n const now = new Date();\n const expiresAt = now.getTime() + expiresInMilliSeconds;\n\n this.storage.setItem('access_token_expires_in', expiresAt);\n this.storage.setItem('access_token_stored_at', Date.now().toString());\n this.setToken(accessToken, refreshToken);\n }\n\n saveUsername(username: string) {\n if (this.storage.supportsStorage()) {\n this.storage.setItem('USERNAME', username);\n }\n }\n\n implicitLogin() {\n if (!this.isValidToken() || !this.isValidAccessToken()) {\n this.redirectLogin();\n }\n }\n\n isValidToken(): boolean {\n let validToken = false;\n if (this.getIdToken()) {\n const expiresAt = this.storage.getItem('id_token_expires_at');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validToken = true;\n }\n }\n\n return validToken;\n }\n\n isValidAccessToken(): boolean {\n let validAccessToken = false;\n\n if (this.getAccessToken()) {\n const expiresAt = this.storage.getItem('access_token_expires_in');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validAccessToken = true;\n }\n }\n\n return validAccessToken;\n }\n\n getIdToken(): string {\n return this.storage.getItem('id_token');\n }\n\n getAccessToken(): string {\n return this.storage.getItem('access_token');\n }\n\n redirectLogin(): void {\n if (this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n const href = this.composeImplicitLoginUrl();\n window.location.href = href;\n this.emit('implicit_redirect', href);\n }\n }\n\n isRedirectionUrl() {\n return window.location.hash && window.location.hash.split('&')[0].indexOf('session_state') === -1;\n }\n\n genNonce(): string {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n for (let i = 0; i < 40; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n }\n\n composeImplicitLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('nonce', nonce);\n\n const afterLoginUriSegment = this.isRedirectionUrl() ? window.location.hash : '';\n if (afterLoginUriSegment && afterLoginUriSegment !== '/') {\n this.storage.setItem('loginFragment', afterLoginUriSegment.replace('#', '').trim());\n }\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce)\n );\n }\n\n composeIframeLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('refresh_nonce', nonce);\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectSilentIframeUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce) +\n '&prompt=none'\n );\n }\n\n hasHashCharacter(hash: string): boolean {\n return hash.indexOf('#') === 0;\n }\n\n startWithHashRoute(hash: string) {\n return hash.startsWith('#/');\n }\n\n getHashFragmentParams(externalHash: string): string {\n let hashFragmentParams = null;\n\n if (typeof window !== 'undefined') {\n let hash: string;\n\n if (!externalHash) {\n hash = decodeURIComponent(window.location.hash);\n if (!this.startWithHashRoute(hash)) {\n window.location.hash = '';\n }\n } else {\n hash = decodeURIComponent(externalHash);\n this.removeHashFromSilentIframe();\n this.destroyIframe();\n }\n\n if (this.hasHashCharacter(hash) && !this.startWithHashRoute(hash)) {\n const questionMarkPosition = hash.indexOf('?');\n\n if (questionMarkPosition > -1) {\n hash = hash.substring(questionMarkPosition + 1);\n } else {\n hash = hash.substring(1);\n }\n hashFragmentParams = this.parseQueryString(hash);\n }\n }\n return hashFragmentParams;\n }\n\n parseQueryString(queryString: string): any {\n const data: { [key: string]: any } = {};\n let pairs: string[];\n let pair: string;\n let separatorIndex: number;\n let escapedKey: string;\n let escapedValue: string;\n let key: string;\n let value: string;\n\n if (queryString !== null) {\n pairs = queryString.split('&');\n\n for (const item of pairs) {\n pair = item;\n separatorIndex = pair.indexOf('=');\n\n if (separatorIndex === -1) {\n escapedKey = pair;\n escapedValue = null;\n } else {\n escapedKey = pair.substring(0, separatorIndex);\n escapedValue = pair.substring(separatorIndex + 1);\n }\n\n key = decodeURIComponent(escapedKey);\n value = decodeURIComponent(escapedValue);\n\n if (key.startsWith('/')) {\n key = key.substring(1);\n }\n\n data[key] = value;\n }\n }\n\n return data;\n }\n\n silentRefresh(): void {\n if (typeof document === 'undefined') {\n this.pollingRefreshToken();\n return;\n }\n\n if (this.checkAccessToken) {\n this.destroyIframe();\n this.createIframe();\n this.checkAccessToken = false;\n return;\n }\n\n this.refreshTokenTimeoutIframe = setTimeout(() => {\n this.destroyIframe();\n this.createIframe();\n }, this.config.oauth2.refreshTokenTimeout);\n }\n\n removeHashFromSilentIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe') as HTMLIFrameElement;\n if (iframe?.contentWindow.location.hash) {\n iframe.contentWindow.location.hash = '';\n }\n }\n\n createIframe() {\n const iframe = document.createElement('iframe');\n iframe.id = 'silent_refresh_token_iframe';\n const loginUrl = this.composeIframeLoginUrl();\n iframe.setAttribute('src', loginUrl);\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n this.iFrameHashListener = () => {\n const silentRefreshTokenIframe: any = document.getElementById('silent_refresh_token_iframe');\n const hash = silentRefreshTokenIframe.contentWindow.location.hash;\n try {\n this.checkFragment('refresh_nonce', hash);\n } catch {\n this.logOut();\n }\n };\n\n iframe.addEventListener('load', this.iFrameHashListener);\n }\n\n destroyIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe');\n\n if (iframe) {\n iframe.removeEventListener('load', this.iFrameHashListener);\n document.body.removeChild(iframe);\n }\n }\n\n /**\n * login Alfresco API\n * @returns A promise that returns {new authentication token} if resolved and {error} if rejected.\n */\n login(username: string, password: string): Promise<any> {\n return new Promise((resolve, reject) => {\n this.grantPasswordLogin(username, password, resolve, reject);\n });\n }\n\n grantPasswordLogin(username: string, password: string, resolve: any, reject: any) {\n this.invalidateSession();\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {\n username,\n password,\n grant_type: 'password',\n client_id: this.config.oauth2.clientId,\n client_secret: this.config.oauth2.secret\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.saveUsername(username);\n this.silentRefresh();\n this.storeAccessToken(data.access_token, data.expires_in, data.refresh_token);\n\n resolve(data);\n },\n (error) => {\n if ((error.error && error.error.status === 401) || error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n pollingRefreshToken() {\n this.refreshTokenIntervalPolling = setInterval(async () => {\n try {\n await this.refreshToken();\n } catch {\n /* continue regardless of error */\n }\n }, this.config.oauth2.refreshTokenTimeout);\n\n this.refreshTokenIntervalPolling.unref();\n }\n\n /**\n * Refresh the Token\n * @returns promise of void\n */\n refreshToken(): Promise<any> {\n const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId + ':' + this.config.oauth2.secret);\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Cache-Control': 'no-cache',\n Authorization: auth\n };\n const formParams = {\n grant_type: 'refresh_token',\n refresh_token: this.authentications.oauth2.refreshToken\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = new Promise((resolve, reject) => {\n this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.setToken(data.access_token, data.refresh_token);\n resolve(data);\n },\n (error) => {\n if (error.error && error.error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n });\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n universalBtoa(stringToConvert: string) {\n try {\n return btoa(stringToConvert);\n } catch {\n return Buffer.from(stringToConvert).toString('base64');\n }\n }\n\n /**\n * Set the current Token\n */\n setToken(token: string, refreshToken: string) {\n this.authentications.oauth2.accessToken = token;\n this.authentications.oauth2.refreshToken = refreshToken;\n this.authentications.basicAuth.password = null;\n this.token = token;\n\n if (token) {\n this.emit('token_issued');\n this.emit('logged-in');\n }\n }\n\n /**\n * Get the current Token\n * @returns token value\n */\n getToken(): string {\n return this.token;\n }\n\n /**\n * return the Authentication\n * @returns authentications\n */\n getAuthentication(): Authentication {\n return this.authentications;\n }\n\n /**\n * Change the Host\n */\n changeHost(host: string) {\n this.config.hostOauth2 = host;\n }\n\n /**\n * If the client is logged in return true\n * @returns is logged in\n */\n isLoggedIn(): boolean {\n return !!this.authentications.oauth2.accessToken;\n }\n\n /**\n * Logout\n */\n async logOut() {\n this.checkAccessToken = true;\n\n const id_token = this.getIdToken();\n\n this.invalidateSession();\n this.setToken(null, null);\n\n const separation = this.discovery.logoutUrl.indexOf('?') > -1 ? '&' : '?';\n const redirectLogout = this.config.oauth2.redirectUriLogout || this.config.oauth2.redirectUri;\n const logoutUrl =\n this.discovery.logoutUrl +\n separation +\n 'post_logout_redirect_uri=' +\n encodeURIComponent(redirectLogout) +\n '&id_token_hint=' +\n encodeURIComponent(id_token);\n\n if (id_token != null && this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n window.location.href = logoutUrl;\n }\n }\n\n invalidateSession() {\n clearTimeout(this.refreshTokenTimeoutIframe);\n clearInterval(this.refreshTokenIntervalPolling);\n\n this.storage.removeItem('access_token');\n this.storage.removeItem('access_token_expires_in');\n this.storage.removeItem('access_token_stored_at');\n\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token_claims_obj');\n this.storage.removeItem('id_token_expires_at');\n this.storage.removeItem('id_token_stored_at');\n\n this.storage.removeItem('nonce');\n }\n\n exchangeTicketListener(alfrescoApi: AlfrescoApi) {\n this.on('token_issued', async () => {\n const authContentApi: AuthenticationApi = new AuthenticationApi(alfrescoApi);\n // Legacy stuff, needs deprecation, can not be more specific here because of circular dependency\n (authContentApi.apiClient as unknown as any).authentications = this.authentications;\n try {\n const ticketEntry = await authContentApi.getTicket();\n this.config.ticketEcm = ticketEntry.entry.id;\n this.emit('ticket_exchanged');\n } catch {\n // continue regardless of error\n }\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"oauth2Auth.js","sourceRoot":"","sources":["oauth2Auth.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;AAEH,iDAA6C;AAC7C,4DAAyD;AAGzD,wDAAyD;AAEzD,wCAAqC;AAErC,wDAAoD;AAepD,MAAa,UAAW,SAAQ,qCAAiB;IAiC7C,YAAY,MAAyB,EAAE,WAAwB,EAAE,UAAuB;QACpF,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QA1BzB,qBAAgB,GAAG,IAAI,CAAC;QAIhC,cAAS,GAKL;YACA,QAAQ,EAAE,SAAS;YACnB,SAAS,EAAE,SAAS;YACpB,aAAa,EAAE,SAAS;YACxB,gBAAgB,EAAE,SAAS;SAC9B,CAAC;QAEF,oBAAe,GAAmB;YAC9B,MAAM,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;YAC3B,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,EAAE;SAChB,CAAC;QAGF,gBAAW,GAAG,IAAI,0B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D,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;QAE9C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,sBAAsB,CAAC,WAAwB;QAC3C,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,GAAS,EAAE;YAC/B,MAAM,cAAc,GAAsB,IAAI,iCAAiB,CAAC,WAAW,CAAC,CAAC;YAE5E,cAAc,CAAC,SAA4B,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;YACpF,IAAI,CAAC;gBACD,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,SAAS,EAAE,CAAC;gBACrD,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC7C,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAClC,CAAC;YAAC,WAAM,CAAC;YAET,CAAC;QACL,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;;AAptBL,gCAqtBC;AAptBmB,oCAAyB,GAAG,+BAA+B,AAAlC,CAAmC;AAC5D,4BAAiB,GAAG,gCAAgC,AAAnC,CAAoC;AACrD,qCAA0B,GAAG,mCAAmC,AAAtC,CAAuC;AACjE,6BAAkB,GAAG,iCAAiC,AAApC,CAAqC","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EventEmitter } from 'eventemitter3';\nimport { AlfrescoApiClient } from '../alfrescoApiClient';\nimport { AlfrescoApiConfig } from '../alfrescoApiConfig';\nimport { Authentication } from './authentication';\nimport { AuthenticationApi } from '../api/auth-rest-api';\nimport { AlfrescoApi } from '../alfrescoApi';\nimport { Storage } from '../storage';\nimport { HttpClient } from '../api-clients/http-client.interface';\nimport { PathMatcher } from '../utils/path-matcher';\n\ndeclare const Buffer: any;\n\ndeclare let window: Window;\n\ninterface Userinfo {\n name: string;\n given_name?: string;\n family_name?: string;\n preferred_username?: string;\n email?: string;\n picture?: string;\n}\n\nexport class Oauth2Auth extends AlfrescoApiClient {\n static readonly DEFAULT_AUTHORIZATION_URL = '/protocol/openid-connect/auth';\n static readonly DEFAULT_TOKEN_URL = '/protocol/openid-connect/token';\n static readonly DEFAULT_USER_INFO_ENDPOINT = '/protocol/openid-connect/userinfo';\n static readonly DEFAULT_LOGOUT_URL = '/protocol/openid-connect/logout';\n\n private refreshTokenIntervalPolling: any;\n private refreshTokenTimeoutIframe: any;\n private checkAccessToken = true;\n\n hashFragmentParams: any;\n token: string;\n discovery: {\n loginUrl?: string;\n logoutUrl?: string;\n tokenEndpoint?: string;\n userinfoEndpoint?: string;\n } = {\n loginUrl: undefined,\n logoutUrl: undefined,\n tokenEndpoint: undefined,\n userinfoEndpoint: undefined\n };\n\n authentications: Authentication = {\n oauth2: { accessToken: '' },\n type: 'oauth2',\n basicAuth: {}\n };\n\n iFrameHashListener: any;\n pathMatcher = new PathMatcher();\n\n constructor(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi, httpClient?: HttpClient) {\n super(undefined, httpClient);\n this.storage = Storage.getInstance();\n\n this.className = 'Oauth2Auth';\n\n if (config) {\n this.setConfig(config, alfrescoApi);\n }\n }\n\n setConfig(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi) {\n this.config = config;\n this.storage.setDomainPrefix(config.domainPrefix);\n\n if (this.config.oauth2) {\n if (this.config.oauth2.host === undefined || this.config.oauth2.host === null) {\n throw new Error('Missing the required oauth2 host parameter');\n }\n\n if (this.config.oauth2.clientId === undefined || this.config.oauth2.clientId === null) {\n throw new Error('Missing the required oauth2 clientId parameter');\n }\n\n if (this.config.oauth2.scope === undefined || this.config.oauth2.scope === null) {\n throw new Error('Missing the required oauth2 scope parameter');\n }\n\n if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) {\n throw new Error('Missing redirectUri required parameter');\n }\n\n if (!this.config.oauth2.refreshTokenTimeout) {\n this.config.oauth2.refreshTokenTimeout = 300000;\n }\n\n if (!this.config.oauth2.redirectSilentIframeUri) {\n let context = '';\n if (typeof window !== 'undefined') {\n context = window.location.origin;\n }\n this.config.oauth2.redirectSilentIframeUri = context + '/assets/silent-refresh.html';\n }\n\n this.basePath = this.config.oauth2.host; //Auth Call\n\n this.host = this.config.oauth2.host;\n\n this.discoveryUrls();\n\n if (this.hasContentProvider()) {\n this.exchangeTicketListener(alfrescoApi);\n }\n\n this.initOauth();\n }\n }\n\n initOauth() {\n if (!this.config.oauth2.implicitFlow && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n }\n\n if (this.config.oauth2.implicitFlow) {\n this.checkFragment('nonce');\n }\n }\n\n discoveryUrls() {\n this.discovery.loginUrl = this.config.oauth2.authorizationUrl || this.host + Oauth2Auth.DEFAULT_AUTHORIZATION_URL;\n this.discovery.logoutUrl = this.config.oauth2.logoutUrl || this.host + Oauth2Auth.DEFAULT_LOGOUT_URL;\n this.discovery.tokenEndpoint = this.config.oauth2.tokenUrl || this.host + Oauth2Auth.DEFAULT_TOKEN_URL;\n this.discovery.userinfoEndpoint = this.config.oauth2.userinfoEndpoint || this.host + Oauth2Auth.DEFAULT_USER_INFO_ENDPOINT;\n }\n\n getProfile(): Promise<Userinfo> {\n const postBody = {};\n const pathParams = {};\n const queryParams = {};\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {};\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n return this.callCustomApi(\n this.discovery.userinfoEndpoint,\n 'GET',\n pathParams,\n queryParams,\n headerParams,\n formParams,\n postBody,\n contentTypes,\n accepts\n );\n }\n\n hasContentProvider(): boolean {\n return this.config.provider === 'ECM' || this.config.provider === 'ALL';\n }\n\n checkFragment(nonceKey?: string, externalHash?: any): any {\n // jshint ignore:line\n this.hashFragmentParams = this.getHashFragmentParams(externalHash);\n\n if (this.hashFragmentParams && this.hashFragmentParams.error === undefined) {\n this.useFragmentTimeLogin(nonceKey);\n } else {\n this.refreshBrowserLogin();\n }\n }\n\n private refreshBrowserLogin() {\n if (this.config.oauth2.silentLogin && !this.isPublicUrl()) {\n this.implicitLogin();\n }\n\n if (this.isValidToken() && this.isValidAccessToken()) {\n const accessToken = this.storage.getItem('access_token');\n this.setToken(accessToken, null);\n this.silentRefresh();\n }\n }\n\n private useFragmentTimeLogin(nonceKey: string) {\n const accessToken = this.hashFragmentParams.access_token;\n const idToken = this.hashFragmentParams.id_token;\n const sessionState = this.hashFragmentParams.session_state;\n const expiresIn = this.hashFragmentParams.expires_in;\n\n if (!sessionState) {\n throw new Error('session state not present');\n }\n\n try {\n const jwt = this.processJWTToken(idToken, nonceKey);\n if (jwt) {\n this.storeIdToken(idToken, jwt.payload.exp);\n this.storeAccessToken(accessToken, expiresIn);\n this.authentications.basicAuth.username = jwt.payload.preferred_username;\n this.saveUsername(jwt.payload.preferred_username);\n this.silentRefresh();\n return accessToken;\n }\n } catch (error) {\n throw new Error('Validation JWT error' + error);\n }\n }\n\n isPublicUrl(): boolean {\n const publicUrls = this.config.oauth2.publicUrls || [];\n\n if (Array.isArray(publicUrls)) {\n return publicUrls.length > 0 && publicUrls.some((urlPattern: string) => this.pathMatcher.match(window.location.href, urlPattern));\n }\n return false;\n }\n\n padBase64(base64data: any) {\n while (base64data.length % 4 !== 0) {\n base64data += '=';\n }\n return base64data;\n }\n\n processJWTToken(jwt: any, nonceKey: string): any {\n if (jwt) {\n const jwtArray = jwt.split('.');\n const headerBase64 = this.padBase64(jwtArray[0]);\n const headerJson = this.b64DecodeUnicode(headerBase64);\n const header = JSON.parse(headerJson);\n\n const payloadBase64 = this.padBase64(jwtArray[1]);\n const payloadJson = this.b64DecodeUnicode(payloadBase64);\n const payload = JSON.parse(payloadJson);\n\n const savedNonce = this.storage.getItem(nonceKey);\n\n if (!payload.sub) {\n throw new Error('Missing sub in JWT');\n }\n\n if (payload.nonce !== savedNonce) {\n return;\n }\n\n return {\n idToken: jwt,\n payload,\n header\n };\n }\n }\n\n b64DecodeUnicode(b64string: string) {\n const base64 = b64string.replace(/-/g, '+').replace(/_/g, '/');\n return decodeURIComponent(\n atob(base64)\n .split('')\n .map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))\n .join('')\n );\n }\n\n storeIdToken(idToken: string, exp: number) {\n this.storage.setItem('id_token', idToken);\n this.storage.setItem('id_token_expires_at', Number(exp * 1000).toString());\n this.storage.setItem('id_token_stored_at', Date.now().toString());\n }\n\n storeAccessToken(accessToken: string, expiresIn: number, refreshToken?: string) {\n this.storage.setItem('access_token', accessToken);\n\n const expiresInMilliSeconds = expiresIn * 1000;\n const now = new Date();\n const expiresAt = now.getTime() + expiresInMilliSeconds;\n\n this.storage.setItem('access_token_expires_in', expiresAt);\n this.storage.setItem('access_token_stored_at', Date.now().toString());\n this.setToken(accessToken, refreshToken);\n }\n\n saveUsername(username: string) {\n if (this.storage.supportsStorage()) {\n this.storage.setItem('USERNAME', username);\n }\n }\n\n implicitLogin() {\n if (!this.isValidToken() || !this.isValidAccessToken()) {\n this.redirectLogin();\n }\n }\n\n isValidToken(): boolean {\n let validToken = false;\n if (this.getIdToken()) {\n const expiresAt = this.storage.getItem('id_token_expires_at');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validToken = true;\n }\n }\n\n return validToken;\n }\n\n isValidAccessToken(): boolean {\n let validAccessToken = false;\n\n if (this.getAccessToken()) {\n const expiresAt = this.storage.getItem('access_token_expires_in');\n const now = new Date();\n if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) {\n validAccessToken = true;\n }\n }\n\n return validAccessToken;\n }\n\n getIdToken(): string {\n return this.storage.getItem('id_token');\n }\n\n getAccessToken(): string {\n return this.storage.getItem('access_token');\n }\n\n redirectLogin(): void {\n if (this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n const href = this.composeImplicitLoginUrl();\n window.location.href = href;\n this.emit('implicit_redirect', href);\n }\n }\n\n isRedirectionUrl() {\n return window.location.hash && window.location.hash.split('&')[0].indexOf('session_state') === -1;\n }\n\n genNonce(): string {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n for (let i = 0; i < 40; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n }\n\n composeImplicitLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('nonce', nonce);\n\n const afterLoginUriSegment = this.isRedirectionUrl() ? window.location.hash : '';\n if (afterLoginUriSegment && afterLoginUriSegment !== '/') {\n this.storage.setItem('loginFragment', afterLoginUriSegment.replace('#', '').trim());\n }\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce)\n );\n }\n\n composeIframeLoginUrl(): string {\n const nonce = this.genNonce();\n\n this.storage.setItem('refresh_nonce', nonce);\n\n const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?';\n\n return (\n this.discovery.loginUrl +\n separation +\n 'client_id=' +\n encodeURIComponent(this.config.oauth2.clientId) +\n '&redirect_uri=' +\n encodeURIComponent(this.config.oauth2.redirectSilentIframeUri) +\n '&scope=' +\n encodeURIComponent(this.config.oauth2.scope) +\n '&response_type=' +\n encodeURIComponent('id_token token') +\n '&nonce=' +\n encodeURIComponent(nonce) +\n '&prompt=none'\n );\n }\n\n hasHashCharacter(hash: string): boolean {\n return hash.indexOf('#') === 0;\n }\n\n startWithHashRoute(hash: string) {\n return hash.startsWith('#/');\n }\n\n getHashFragmentParams(externalHash: string): string {\n let hashFragmentParams = null;\n\n if (typeof window !== 'undefined') {\n let hash: string;\n\n if (!externalHash) {\n hash = decodeURIComponent(window.location.hash);\n if (!this.startWithHashRoute(hash)) {\n window.location.hash = '';\n }\n } else {\n hash = decodeURIComponent(externalHash);\n this.removeHashFromSilentIframe();\n this.destroyIframe();\n }\n\n if (this.hasHashCharacter(hash) && !this.startWithHashRoute(hash)) {\n const questionMarkPosition = hash.indexOf('?');\n\n if (questionMarkPosition > -1) {\n hash = hash.substring(questionMarkPosition + 1);\n } else {\n hash = hash.substring(1);\n }\n hashFragmentParams = this.parseQueryString(hash);\n }\n }\n return hashFragmentParams;\n }\n\n parseQueryString(queryString: string): any {\n const data: { [key: string]: any } = {};\n let pairs: string[];\n let pair: string;\n let separatorIndex: number;\n let escapedKey: string;\n let escapedValue: string;\n let key: string;\n let value: string;\n\n if (queryString !== null) {\n pairs = queryString.split('&');\n\n for (const item of pairs) {\n pair = item;\n separatorIndex = pair.indexOf('=');\n\n if (separatorIndex === -1) {\n escapedKey = pair;\n escapedValue = null;\n } else {\n escapedKey = pair.substring(0, separatorIndex);\n escapedValue = pair.substring(separatorIndex + 1);\n }\n\n key = decodeURIComponent(escapedKey);\n value = decodeURIComponent(escapedValue);\n\n if (key.startsWith('/')) {\n key = key.substring(1);\n }\n\n data[key] = value;\n }\n }\n\n return data;\n }\n\n silentRefresh(): void {\n if (typeof document === 'undefined') {\n this.pollingRefreshToken();\n return;\n }\n\n if (this.checkAccessToken) {\n this.destroyIframe();\n this.createIframe();\n this.checkAccessToken = false;\n return;\n }\n\n this.refreshTokenTimeoutIframe = setTimeout(() => {\n this.destroyIframe();\n this.createIframe();\n }, this.config.oauth2.refreshTokenTimeout);\n }\n\n removeHashFromSilentIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe') as HTMLIFrameElement;\n if (iframe?.contentWindow.location.hash) {\n iframe.contentWindow.location.hash = '';\n }\n }\n\n createIframe() {\n const iframe = document.createElement('iframe');\n iframe.id = 'silent_refresh_token_iframe';\n const loginUrl = this.composeIframeLoginUrl();\n iframe.setAttribute('src', loginUrl);\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n this.iFrameHashListener = () => {\n const silentRefreshTokenIframe: any = document.getElementById('silent_refresh_token_iframe');\n const hash = silentRefreshTokenIframe.contentWindow.location.hash;\n try {\n this.checkFragment('refresh_nonce', hash);\n } catch {\n this.logOut();\n }\n };\n\n iframe.addEventListener('load', this.iFrameHashListener);\n }\n\n destroyIframe() {\n const iframe = document.getElementById('silent_refresh_token_iframe');\n\n if (iframe) {\n iframe.removeEventListener('load', this.iFrameHashListener);\n document.body.removeChild(iframe);\n }\n }\n\n /**\n * login Alfresco API\n * @returns A promise that returns {new authentication token} if resolved and {error} if rejected.\n */\n login(username: string, password: string): Promise<any> {\n return new Promise((resolve, reject) => {\n this.grantPasswordLogin(username, password, resolve, reject);\n });\n }\n\n grantPasswordLogin(username: string, password: string, resolve: any, reject: any) {\n this.invalidateSession();\n\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n const formParams = {\n username,\n password,\n grant_type: 'password',\n client_id: this.config.oauth2.clientId\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.saveUsername(username);\n this.silentRefresh();\n this.storeAccessToken(data.access_token, data.expires_in, data.refresh_token);\n\n resolve(data);\n },\n (error) => {\n if ((error.error && error.error.status === 401) || error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n pollingRefreshToken() {\n this.refreshTokenIntervalPolling = setInterval(async () => {\n try {\n await this.refreshToken();\n } catch {\n /* continue regardless of error */\n }\n }, this.config.oauth2.refreshTokenTimeout);\n\n this.refreshTokenIntervalPolling.unref();\n }\n\n /**\n * Refresh the Token\n * @returns promise of void\n */\n refreshToken(): Promise<any> {\n const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId);\n const headerParams = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Cache-Control': 'no-cache',\n Authorization: auth\n };\n const formParams = {\n grant_type: 'refresh_token',\n refresh_token: this.authentications.oauth2.refreshToken\n };\n\n const contentTypes = ['application/x-www-form-urlencoded'];\n const accepts = ['application/json'];\n\n const promise = new Promise((resolve, reject) => {\n this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then(\n (data: any) => {\n this.setToken(data.access_token, data.refresh_token);\n resolve(data);\n },\n (error) => {\n if (error.error && error.error.status === 401) {\n this.emit('unauthorized');\n }\n this.emit('error');\n reject(error.error);\n }\n );\n });\n\n return this.addPromiseListeners(promise, new EventEmitter());\n }\n\n universalBtoa(stringToConvert: string) {\n try {\n return btoa(stringToConvert);\n } catch {\n return Buffer.from(stringToConvert).toString('base64');\n }\n }\n\n /**\n * Set the current Token\n */\n setToken(token: string, refreshToken: string) {\n this.authentications.oauth2.accessToken = token;\n this.authentications.oauth2.refreshToken = refreshToken;\n this.authentications.basicAuth.password = null;\n this.token = token;\n\n if (token) {\n this.emit('token_issued');\n this.emit('logged-in');\n }\n }\n\n /**\n * Get the current Token\n * @returns token value\n */\n getToken(): string {\n return this.token;\n }\n\n /**\n * return the Authentication\n * @returns authentications\n */\n getAuthentication(): Authentication {\n return this.authentications;\n }\n\n /**\n * Change the Host\n */\n changeHost(host: string) {\n this.config.hostOauth2 = host;\n }\n\n /**\n * If the client is logged in return true\n * @returns is logged in\n */\n isLoggedIn(): boolean {\n return !!this.authentications.oauth2.accessToken;\n }\n\n /**\n * Logout\n */\n async logOut() {\n this.checkAccessToken = true;\n\n const id_token = this.getIdToken();\n\n this.invalidateSession();\n this.setToken(null, null);\n\n const separation = this.discovery.logoutUrl.indexOf('?') > -1 ? '&' : '?';\n const redirectLogout = this.config.oauth2.redirectUriLogout || this.config.oauth2.redirectUri;\n const logoutUrl =\n this.discovery.logoutUrl +\n separation +\n 'post_logout_redirect_uri=' +\n encodeURIComponent(redirectLogout) +\n '&id_token_hint=' +\n encodeURIComponent(id_token);\n\n if (id_token != null && this.config.oauth2.implicitFlow && typeof window !== 'undefined') {\n window.location.href = logoutUrl;\n }\n }\n\n invalidateSession() {\n clearTimeout(this.refreshTokenTimeoutIframe);\n clearInterval(this.refreshTokenIntervalPolling);\n\n this.storage.removeItem('access_token');\n this.storage.removeItem('access_token_expires_in');\n this.storage.removeItem('access_token_stored_at');\n\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token');\n this.storage.removeItem('id_token_claims_obj');\n this.storage.removeItem('id_token_expires_at');\n this.storage.removeItem('id_token_stored_at');\n\n this.storage.removeItem('nonce');\n }\n\n exchangeTicketListener(alfrescoApi: AlfrescoApi) {\n this.on('token_issued', async () => {\n const authContentApi: AuthenticationApi = new AuthenticationApi(alfrescoApi);\n // Legacy stuff, needs deprecation, can not be more specific here because of circular dependency\n (authContentApi.apiClient as unknown as any).authentications = this.authentications;\n try {\n const ticketEntry = await authContentApi.getTicket();\n this.config.ticketEcm = ticketEntry.entry.id;\n this.emit('ticket_exchanged');\n } catch {\n // continue regardless of error\n }\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2Config.js","sourceRoot":"","sources":["oauth2Config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Oauth2Config {\n clientId: string;\n
|
|
1
|
+
{"version":3,"file":"oauth2Config.js","sourceRoot":"","sources":["oauth2Config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG","sourcesContent":["/*!\n * @license\n * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Oauth2Config {\n clientId: string;\n host: string;\n authorizationUrl?: string;\n tokenUrl?: string;\n userinfoEndpoint?: string;\n logoutUrl?: string;\n scope: string;\n implicitFlow?: boolean;\n redirectUri: string;\n refreshTokenTimeout?: number;\n silentLogin?: boolean;\n redirectUriLogout?: string;\n redirectSilentIframeUri?: string;\n publicUrls?: string[];\n}\n"]}
|
package/typings/package.json
CHANGED