mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-10592] Remove 'secret' field from OAUTH config across ADF/ACA/ADW (#11332)
This commit is contained in:
@@ -128,7 +128,7 @@ If your want to redirect to the authorization server and login there, you can us
|
||||
|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
|
||||
| host | Your oauth2 server URL | null |
|
||||
| clientId | Your clientId oauth2 | null |
|
||||
| secret | Your secret oauth2 | null |
|
||||
| secret | **Deprecated** - Not used in implicit flow and should not be included in browser applications | null |
|
||||
| scope | Your scope | null |
|
||||
| implicitFlow | true/false | false |
|
||||
| redirectUri | url to be redirect after login | null |
|
||||
@@ -160,7 +160,6 @@ const alfrescoApi = new AlfrescoApi({
|
||||
oauth2: {
|
||||
host: 'HOST_OAUTH2_SERVER',
|
||||
clientId: 'YOUR_CLIENT_ID',
|
||||
secret: 'SECRET',
|
||||
scope: 'openid',
|
||||
implicitFlow: true,
|
||||
redirectUri: 'YOUR_HOME_APP_URL',
|
||||
@@ -180,7 +179,6 @@ const alfrescoApi = new AlfrescoApi({
|
||||
oauth2: {
|
||||
host: 'HOST_OAUTH2_SERVER',
|
||||
clientId: 'YOUR_CLIENT_ID',
|
||||
secret: 'SECRET',
|
||||
scope: 'openid',
|
||||
implicitFlow: true,
|
||||
redirectUri: 'YOUR_HOME_APP_URL',
|
||||
@@ -202,7 +200,6 @@ const alfrescoApi = new AlfrescoApi({
|
||||
oauth2: {
|
||||
host: 'HOST_OAUTH2_SERVER',
|
||||
clientId: 'YOUR_CLIENT_ID',
|
||||
secret: 'SECRET'
|
||||
},
|
||||
authType: 'OAUTH',
|
||||
provider: 'ALL'
|
||||
|
||||
@@ -99,10 +99,6 @@ export class Oauth2Auth extends AlfrescoApiClient {
|
||||
throw new Error('Missing the required oauth2 scope parameter');
|
||||
}
|
||||
|
||||
if (this.config.oauth2.secret === undefined || this.config.oauth2.secret === null) {
|
||||
this.config.oauth2.secret = '';
|
||||
}
|
||||
|
||||
if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) {
|
||||
throw new Error('Missing redirectUri required parameter');
|
||||
}
|
||||
@@ -580,8 +576,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
|
||||
username,
|
||||
password,
|
||||
grant_type: 'password',
|
||||
client_id: this.config.oauth2.clientId,
|
||||
client_secret: this.config.oauth2.secret
|
||||
client_id: this.config.oauth2.clientId
|
||||
};
|
||||
|
||||
const contentTypes = ['application/x-www-form-urlencoded'];
|
||||
@@ -624,7 +619,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
|
||||
* @returns promise of void
|
||||
*/
|
||||
refreshToken(): Promise<any> {
|
||||
const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId + ':' + this.config.oauth2.secret);
|
||||
const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId);
|
||||
const headerParams = {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cache-Control': 'no-cache',
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
export interface Oauth2Config {
|
||||
clientId: string;
|
||||
secret?: string;
|
||||
host: string;
|
||||
authorizationUrl?: string;
|
||||
tokenUrl?: string;
|
||||
|
||||
@@ -326,7 +326,6 @@ describe('Basic configuration test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
|
||||
@@ -128,7 +128,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -143,7 +142,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -175,7 +173,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -201,7 +198,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout',
|
||||
implicitFlow: false,
|
||||
@@ -271,7 +267,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -297,7 +292,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -331,7 +325,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -358,7 +351,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -385,7 +377,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -420,7 +411,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -460,7 +450,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -500,7 +489,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -525,7 +513,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -549,7 +536,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
@@ -586,7 +572,6 @@ describe('Oauth2 test', () => {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
scope: 'openid',
|
||||
secret: '',
|
||||
redirectUri: '/',
|
||||
redirectUriLogout: '/logout'
|
||||
},
|
||||
|
||||
@@ -55,7 +55,6 @@ describe('Oauth2 Implicit flow test', () => {
|
||||
oauth2: {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
secret: '',
|
||||
scope: 'openid',
|
||||
implicitFlow: true,
|
||||
redirectUri: undefined
|
||||
@@ -77,7 +76,6 @@ describe('Oauth2 Implicit flow test', () => {
|
||||
oauth2: {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
secret: '',
|
||||
scope: 'openid',
|
||||
implicitFlow: true,
|
||||
redirectUri: 'redirectUri'
|
||||
@@ -101,7 +99,6 @@ describe('Oauth2 Implicit flow test', () => {
|
||||
oauth2: {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
secret: '',
|
||||
scope: 'openid',
|
||||
implicitFlow: true,
|
||||
redirectUri: '#/redirectUri'
|
||||
@@ -129,7 +126,6 @@ describe('Oauth2 Implicit flow test', () => {
|
||||
oauth2: {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
secret: '',
|
||||
scope: 'openid',
|
||||
implicitFlow: true,
|
||||
redirectUri: 'redirectUri'
|
||||
@@ -161,7 +157,6 @@ describe('Oauth2 Implicit flow test', () => {
|
||||
oauth2: {
|
||||
host: 'https://myOauthUrl:30081/auth/realms/springboot',
|
||||
clientId: 'activiti',
|
||||
secret: '',
|
||||
scope: 'openid',
|
||||
implicitFlow: true,
|
||||
redirectUri: 'redirectUri'
|
||||
|
||||
Reference in New Issue
Block a user