[
https://issues.apache.org/jira/browse/AIRAVATA-3395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17249108#comment-17249108
]
Marcus Christie commented on AIRAVATA-3395:
-------------------------------------------
I used kcadm.sh to set the config.issuer field to null:
{code}
export MASTER_REALM_USER=...
cd Airavata/keycloak-2.5.5.Final/
export PATH=$PWD/bin:$PATH
kcadm.sh config credentials --server https://iam.scigap.org/auth --realm master
--user $MASTER_REALM_USER
{code}
{code}
kcadm.sh get identity-provider/instances/cilogon -r covid-geoact
{code}
{code:title=output}
{
"alias" : "cilogon",
"internalId" : "f81038af-1450-4964-9cdd-cf3f307d2053",
"providerId" : "oidc",
"enabled" : true,
"updateProfileFirstLoginMode" : "on",
"trustEmail" : true,
"storeToken" : false,
"addReadTokenRoleOnCreate" : false,
"authenticateByDefault" : false,
"firstBrokerLoginFlowAlias" : "first broker login",
"config" : {
"userInfoUrl" : "https://cilogon.org/oauth2/userinfo",
"clientId" : "cilogon:/client_id/ef95de676241499cbef82c9d38f560b",
"tokenUrl" : "https://cilogon.org/oauth2/token",
"authorizationUrl" : "https://cilogon.org/authorize",
"clientSecret" : "**********",
"defaultScope" : "openid email profile org.cilogon.userinfo",
"issuer" : "",
"useJwksUrl" : "true"
}
}
{code}
Note above that the value of {{config.issuer}} is {{""}}.
{code}
kcadm.sh update identity-provider/instances/cilogon -r covid-geoact -s
'config.issuer=null'
{code}
{code}
kcadm.sh get identity-provider/instances/cilogon -r covid-geoact
{code}
{code:title=output}
{
"alias" : "cilogon",
"internalId" : "f81038af-1450-4964-9cdd-cf3f307d2053",
"providerId" : "oidc",
"enabled" : true,
"updateProfileFirstLoginMode" : "on",
"trustEmail" : true,
"storeToken" : false,
"addReadTokenRoleOnCreate" : false,
"authenticateByDefault" : false,
"firstBrokerLoginFlowAlias" : "first broker login",
"config" : {
"userInfoUrl" : "https://cilogon.org/oauth2/userinfo",
"clientId" : "cilogon:/client_id/ef95de676241499cbef82c9d38f560b",
"tokenUrl" : "https://cilogon.org/oauth2/token",
"authorizationUrl" : "https://cilogon.org/authorize",
"clientSecret" : "**********",
"defaultScope" : "openid email profile org.cilogon.userinfo",
"useJwksUrl" : "true"
}
}
{code}
> Keycloak: Unexpected error when authenticating with identity provider: Failed
> to make identity provider oauth callback:
> org.keycloak.broker.provider.IdentityBrokerException: Wrong issuer from
> token. Got: https://cilogon.org expected:
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AIRAVATA-3395
> URL: https://issues.apache.org/jira/browse/AIRAVATA-3395
> Project: Airavata
> Issue Type: Bug
> Reporter: Marcus Christie
> Assignee: Marcus Christie
> Priority: Major
>
> Stack trace:
> {code}
> 2020-12-14 11:23:49,488 ERROR
> [org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider] (default task-21)
> Failed to mak
> e identity provider oauth callback:
> org.keycloak.broker.provider.IdentityBrokerException: Wrong issuer from
> token. Got:
> https://cilogon.org expected:
> at
> org.keycloak.broker.oidc.OIDCIdentityProvider.validateToken(OIDCIdentityProvider.java:352)
> at
> org.keycloak.broker.oidc.OIDCIdentityProvider.getFederatedIdentity(OIDCIdentityProvider.java:237)
> at
> org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider$Endpoint.authResponse(AbstractOAuth2IdentityProvider
> .java:230)
> at sun.reflect.GeneratedMethodAccessor886.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
> at
> org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
> at
> org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
> at
> org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:138)
> at
> org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:107)
> at
> org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:133)
> at
> org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:101)
> at
> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395)
> at
> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)
> at
> org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
> at
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
> at
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at
> io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
> at
> io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
> at
> org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:90)
> at
> io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
> at
> io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
> at
> io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
> at
> io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
> at
> io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
> at
> org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
> at
> io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
> at
> io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
> at
> io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
> at
> io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
> at
> io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
> at
> io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
> at
> io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
> at
> io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
> at
> io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
> at
> io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
> at
> io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
> ...
> {code}
> The problem is that identity provider config has an {{issuer}} value of ""
> (empty string). Not sure how that happened.
> There's no way in the UI (that I could figure out) to remove the issuer
> value. I ended up using the command line REST API client to make the update.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)