Skip to content

Commit

Permalink
Fix grant types not showing issue for OAuth2/OIDC
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario committed Oct 5, 2021
1 parent 75221a1 commit 89de15f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,17 @@ export const AccessConfiguration: FunctionComponent<AccessConfigurationPropsInte
]
}
initialValues={
get(inboundProtocolConfig, selectedProtocol)
? inboundProtocolConfig[ selectedProtocol ]
get(
inboundProtocolConfig,
selectedProtocol === SupportedAuthProtocolTypes.OAUTH2_OIDC
? SupportedAuthProtocolTypes.OIDC
: selectedProtocol
)
? inboundProtocolConfig[
selectedProtocol === SupportedAuthProtocolTypes.OAUTH2_OIDC
? SupportedAuthProtocolTypes.OIDC
: selectedProtocol
]
: undefined
}
onSubmit={ handleSubmit }
Expand Down Expand Up @@ -590,8 +599,17 @@ export const AccessConfiguration: FunctionComponent<AccessConfigurationPropsInte
]
}
initialValues={
get(inboundProtocolConfig, selectedProtocol)
? inboundProtocolConfig[ selectedProtocol ]
get(
inboundProtocolConfig,
selectedProtocol === SupportedAuthProtocolTypes.OAUTH2_OIDC
? SupportedAuthProtocolTypes.OIDC
: selectedProtocol
)
? inboundProtocolConfig[
selectedProtocol === SupportedAuthProtocolTypes.OAUTH2_OIDC
? SupportedAuthProtocolTypes.OIDC
: selectedProtocol
]
: undefined
}
onSubmit={ handleSubmit }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ export const MinimalAppCreateWizard: FunctionComponent<MinimalApplicationCreateW
delete templateSettingsClone?.application?.inboundProtocolConfiguration?.saml?.templateConfiguration;
}

const application: MainApplicationInterface = merge(templateSettingsClone?.application, protocolFormValues);
const application: MainApplicationInterface = cloneDeep(merge(templateSettingsClone?.application,
protocolFormValues));

application.name = generalFormValues.get("name").toString();
application.templateId = selectedTemplate.id;
Expand All @@ -262,6 +263,14 @@ export const MinimalAppCreateWizard: FunctionComponent<MinimalApplicationCreateW
if (selectedTemplate.id === CustomApplicationTemplate.id) {
if (customApplicationProtocol === SupportedAuthProtocolTypes.OAUTH2_OIDC) {
application.templateId = ApplicationManagementConstants.CUSTOM_APPLICATION_OIDC;
// Custom OAuth2/OIDC Apps are created with `client_credentials` grant by default.
application.inboundProtocolConfiguration = {
oidc: {
grantTypes: [
"client_credentials"
]
}
};
} else if (customApplicationProtocol === SupportedAuthProtocolTypes.SAML) {
application.templateId = ApplicationManagementConstants.CUSTOM_APPLICATION_SAML;
} else if (customApplicationProtocol === SupportedAuthProtocolTypes.WS_FEDERATION) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,5 @@
"oidc",
"saml"
],
"application": {
"name": "",
"inboundProtocolConfiguration": {
"oidc": {
"grantTypes": [
"client_credentials"
]
}
}
}
"application": null
}

0 comments on commit 89de15f

Please sign in to comment.