|
|
@ -60,7 +60,7 @@ export class OAuth2SettingsComponent extends PageComponent implements OnInit, Ha |
|
|
additionalInfo: { |
|
|
additionalInfo: { |
|
|
providerName: 'Custom' |
|
|
providerName: 'Custom' |
|
|
}, |
|
|
}, |
|
|
clientAuthenticationMethod: 'Post', |
|
|
clientAuthenticationMethod: 'POST', |
|
|
userNameAttributeName: 'email', |
|
|
userNameAttributeName: 'email', |
|
|
mapperConfig: { |
|
|
mapperConfig: { |
|
|
allowUserCreation: true, |
|
|
allowUserCreation: true, |
|
|
@ -249,17 +249,17 @@ export class OAuth2SettingsComponent extends PageComponent implements OnInit, Ha |
|
|
loginButtonIcon: [registrationData?.loginButtonIcon ? registrationData.loginButtonIcon : null], |
|
|
loginButtonIcon: [registrationData?.loginButtonIcon ? registrationData.loginButtonIcon : null], |
|
|
clientId: [registrationData?.clientId ? registrationData.clientId : '', Validators.required], |
|
|
clientId: [registrationData?.clientId ? registrationData.clientId : '', Validators.required], |
|
|
clientSecret: [registrationData?.clientSecret ? registrationData.clientSecret : '', Validators.required], |
|
|
clientSecret: [registrationData?.clientSecret ? registrationData.clientSecret : '', Validators.required], |
|
|
accessTokenUri: [registrationData?.accessTokenUri ? registrationData.accessTokenUri : '', [ |
|
|
accessTokenUri: [registrationData?.accessTokenUri ? registrationData.accessTokenUri : '', |
|
|
Validators.required, |
|
|
[Validators.required, |
|
|
Validators.pattern(this.URL_REGEXP)]], |
|
|
Validators.pattern(this.URL_REGEXP)]], |
|
|
authorizationUri: [registrationData?.authorizationUri ? registrationData.authorizationUri : '', [ |
|
|
authorizationUri: [registrationData?.authorizationUri ? registrationData.authorizationUri : '', |
|
|
Validators.required, |
|
|
[Validators.required, |
|
|
Validators.pattern(this.URL_REGEXP)]], |
|
|
Validators.pattern(this.URL_REGEXP)]], |
|
|
scope: this.fb.array(registrationData?.scope ? registrationData.scope : []), |
|
|
scope: this.fb.array(registrationData?.scope ? registrationData.scope : []), |
|
|
jwkSetUri: [registrationData?.jwkSetUri ? registrationData.jwkSetUri : '', Validators.pattern(this.URL_REGEXP)], |
|
|
jwkSetUri: [registrationData?.jwkSetUri ? registrationData.jwkSetUri : '', Validators.pattern(this.URL_REGEXP)], |
|
|
userInfoUri: [registrationData?.userInfoUri ? registrationData.userInfoUri : '', [ |
|
|
userInfoUri: [registrationData?.userInfoUri ? registrationData.userInfoUri : '', |
|
|
Validators.required, |
|
|
[Validators.required, |
|
|
Validators.pattern(this.URL_REGEXP)]], |
|
|
Validators.pattern(this.URL_REGEXP)]], |
|
|
clientAuthenticationMethod: [ |
|
|
clientAuthenticationMethod: [ |
|
|
registrationData?.clientAuthenticationMethod ? registrationData.clientAuthenticationMethod : 'POST', Validators.required], |
|
|
registrationData?.clientAuthenticationMethod ? registrationData.clientAuthenticationMethod : 'POST', Validators.required], |
|
|
userNameAttributeName: [ |
|
|
userNameAttributeName: [ |
|
|
@ -285,7 +285,8 @@ export class OAuth2SettingsComponent extends PageComponent implements OnInit, Ha |
|
|
this.subscriptions.push(clientRegistration.get('additionalInfo.providerName').valueChanges.subscribe((provider) => { |
|
|
this.subscriptions.push(clientRegistration.get('additionalInfo.providerName').valueChanges.subscribe((provider) => { |
|
|
(clientRegistration.get('scope') as FormArray).clear(); |
|
|
(clientRegistration.get('scope') as FormArray).clear(); |
|
|
if (provider === 'Custom') { |
|
|
if (provider === 'Custom') { |
|
|
clientRegistration.reset(this.defaultProvider, {emitEvent: false}); |
|
|
const defaultSettings = {...this.defaultProvider, ...{id: clientRegistration.get('id').value}}; |
|
|
|
|
|
clientRegistration.reset(defaultSettings, {emitEvent: false}); |
|
|
clientRegistration.get('accessTokenUri').enable(); |
|
|
clientRegistration.get('accessTokenUri').enable(); |
|
|
clientRegistration.get('authorizationUri').enable(); |
|
|
clientRegistration.get('authorizationUri').enable(); |
|
|
clientRegistration.get('jwkSetUri').enable(); |
|
|
clientRegistration.get('jwkSetUri').enable(); |
|
|
@ -294,6 +295,8 @@ export class OAuth2SettingsComponent extends PageComponent implements OnInit, Ha |
|
|
const template = this.templates.get(provider); |
|
|
const template = this.templates.get(provider); |
|
|
delete template.id; |
|
|
delete template.id; |
|
|
delete template.additionalInfo; |
|
|
delete template.additionalInfo; |
|
|
|
|
|
template.clientId = ''; |
|
|
|
|
|
template.clientSecret = ''; |
|
|
template.scope.forEach(() => { |
|
|
template.scope.forEach(() => { |
|
|
(clientRegistration.get('scope') as FormArray).push(this.fb.control('')); |
|
|
(clientRegistration.get('scope') as FormArray).push(this.fb.control('')); |
|
|
}); |
|
|
}); |
|
|
@ -301,13 +304,7 @@ export class OAuth2SettingsComponent extends PageComponent implements OnInit, Ha |
|
|
clientRegistration.get('authorizationUri').disable(); |
|
|
clientRegistration.get('authorizationUri').disable(); |
|
|
clientRegistration.get('jwkSetUri').disable(); |
|
|
clientRegistration.get('jwkSetUri').disable(); |
|
|
clientRegistration.get('userInfoUri').disable(); |
|
|
clientRegistration.get('userInfoUri').disable(); |
|
|
clientRegistration.patchValue({ |
|
|
clientRegistration.patchValue(template, {emitEvent: false}); |
|
|
...template, ...{ |
|
|
|
|
|
clientId: '', |
|
|
|
|
|
clientSecret: '', |
|
|
|
|
|
id: {id: null, entityType: null} |
|
|
|
|
|
} |
|
|
|
|
|
}, {emitEvent: false}); |
|
|
|
|
|
} |
|
|
} |
|
|
})); |
|
|
})); |
|
|
|
|
|
|
|
|
@ -469,7 +466,8 @@ export class OAuth2SettingsComponent extends PageComponent implements OnInit, Ha |
|
|
componentRef.onDestroy(() => { |
|
|
componentRef.onDestroy(() => { |
|
|
if (componentRef.instance.result !== null) { |
|
|
if (componentRef.instance.result !== null) { |
|
|
const attributeValue = componentRef.instance.result; |
|
|
const attributeValue = componentRef.instance.result; |
|
|
this.clientDomains.at(index).get('redirectUriTemplate').patchValue(attributeValue, {emitEvent: true}); |
|
|
this.clientDomains.at(index).get('redirectUriTemplate').patchValue(attributeValue); |
|
|
|
|
|
this.clientDomains.at(index).get('redirectUriTemplate').markAsDirty(); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|