refactor: move OIDC client secret to non public app setting (#2558)
This commit is contained in:
+1
-1
@@ -118,7 +118,7 @@
|
||||
pSize="small"
|
||||
id="clientSecret"
|
||||
type="password"
|
||||
[(ngModel)]="oidcProvider.clientSecret"
|
||||
[(ngModel)]="oidcProviderClientSecret"
|
||||
[placeholder]="t('providerConfig.clientSecretPlaceholder')"/>
|
||||
<span class="field-hint">{{ t('providerConfig.clientSecretHint') }}</span>
|
||||
</div>
|
||||
|
||||
+10
-3
@@ -30,7 +30,6 @@ function completeProvider(overrides: Partial<OidcProviderDetails> = {}): OidcPro
|
||||
return {
|
||||
providerName: 'Example IdP',
|
||||
clientId: 'client-id',
|
||||
clientSecret: 'secret',
|
||||
issuerUri: 'https://issuer.example',
|
||||
scopes: 'openid profile email',
|
||||
claimMapping: {
|
||||
@@ -280,7 +279,11 @@ describe('AuthenticationSettingsComponent', () => {
|
||||
{
|
||||
key: AppSettingKey.OIDC_REDIRECT_URIS,
|
||||
newValue: ['grimmory://oauth2-callback', 'grimmory://auth/return'],
|
||||
}
|
||||
},
|
||||
{
|
||||
key: AppSettingKey.OIDC_PROVIDER_CLIENT_SECRET,
|
||||
newValue: "",
|
||||
},
|
||||
]);
|
||||
|
||||
component.oidcEnabled = true;
|
||||
@@ -295,10 +298,14 @@ describe('AuthenticationSettingsComponent', () => {
|
||||
key: AppSettingKey.OIDC_REDIRECT_URIS,
|
||||
newValue: ['grimmory://oauth2-callback', 'grimmory://auth/return'],
|
||||
},
|
||||
{
|
||||
key: AppSettingKey.OIDC_PROVIDER_CLIENT_SECRET,
|
||||
newValue: "",
|
||||
},
|
||||
{
|
||||
key: AppSettingKey.OIDC_SESSION_DURATION_HOURS,
|
||||
newValue: 24,
|
||||
}
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
+8
-2
@@ -113,10 +113,11 @@ export class AuthenticationSettingsComponent {
|
||||
readonly groupMappings = signal<OidcGroupMapping[]>([]);
|
||||
readonly groupMappingDraft = signal<OidcGroupMapping | null>(null);
|
||||
|
||||
oidcProviderClientSecret: string = '';
|
||||
|
||||
oidcProvider: OidcProviderDetails = {
|
||||
providerName: '',
|
||||
clientId: '',
|
||||
clientSecret: '',
|
||||
issuerUri: '',
|
||||
scopes: '',
|
||||
claimMapping: {
|
||||
@@ -172,9 +173,10 @@ export class AuthenticationSettingsComponent {
|
||||
issuerUri: settings.oidcProviderDetails?.issuerUri || '',
|
||||
scopes: settings.oidcProviderDetails?.scopes || '',
|
||||
claimMapping: settings.oidcProviderDetails?.claimMapping || defaultClaimMapping,
|
||||
clientSecret: settings.oidcProviderDetails?.clientSecret || '',
|
||||
};
|
||||
|
||||
this.oidcProviderClientSecret = settings.oidcProviderClientSecret || '';
|
||||
|
||||
this.availablePermissions.forEach(perm => {
|
||||
perm.selected = this.selectedPermissions.includes(perm.value);
|
||||
});
|
||||
@@ -216,6 +218,10 @@ export class AuthenticationSettingsComponent {
|
||||
{
|
||||
key: AppSettingKey.OIDC_REDIRECT_URIS,
|
||||
newValue: this.mobileRedirectUris
|
||||
},
|
||||
{
|
||||
key: AppSettingKey.OIDC_PROVIDER_CLIENT_SECRET,
|
||||
newValue: this.oidcProviderClientSecret
|
||||
}
|
||||
];
|
||||
if (this.oidcEnabled) {
|
||||
|
||||
Reference in New Issue
Block a user