Damans227 commented on code in PR #14205:
URL: https://github.com/apache/cloudstack/pull/14205#discussion_r4158484965
##########
plugins/user-authenticators/oauth2/src/main/java/org/apache/cloudstack/oauth2/OAuth2AuthManagerImpl.java:
##########
@@ -168,11 +185,17 @@ public OauthProviderVO
registerOauthProvider(RegisterOAuthProviderCmd cmd) {
Long domainId =
normalizeGlobalScope(resolveDomainIdFromIdOrPath(cmd.getDomainId(),
cmd.getDomainPath()));
String authorizeUrl = StringUtils.trim(cmd.getAuthorizeUrl());
String tokenUrl = StringUtils.trim(cmd.getTokenUrl());
+ String type = StringUtils.trim(cmd.getType());
+ String issuerUrl = StringUtils.trim(cmd.getIssuerUrl());
if (!isOAuthPluginEnabled(domainId)) {
throw new CloudRuntimeException("OAuth is not enabled, please
enable to register");
}
+ if (StringUtils.isNotBlank(type) &&
!userOAuth2AuthenticationProvidersMap.containsKey(type.toLowerCase())) {
+ throw new CloudRuntimeException(String.format("No OAuth2 provider
plugin is available for the type %s", type));
Review Comment:
got it, thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]