0

I am trying to run IBM App ID on localhost. The App ID Login Widget is coming up. But after login it is not redirecting to my application. It is showing the login page again.

The same codebase is running on CF instance very well.

URL : https://us-south.appid.cloud.ibm.com/oauth/v4/xxxxxxx-62a9-4a02-8710-f421c59571a5/authorization?response_type=code&client_id=xxxxxxx-4c08-4f11-8370-181061306b65&state=001630038048040MsOwH2vS2&redirect_uri=https://localhost:9443/ne/oidcclient/redirect/MyRP&scope=openid+profile&language=en

Server.xml

    <server description="new server">
    <!-- Enable features -->
    <featureManager>
    <feature>jsp-2.3</feature>
    <feature>localConnector-1.0</feature>
    <!-- Features for APP ID -->
    <feature>servlet-3.1</feature>
    <feature>appSecurity-2.0</feature>
    <feature>openidConnectClient-1.0</feature>
    <feature>ssl-1.0</feature>
    </featureManager>
    <authFilter>
      <requestUrl matchType="notContain" urlPattern="/getToken"/>
     </authFilter>
     <!-- To access this server from a remote client add a host attribute to the following 
      element, e.g. host="*" -->
    <httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>

    <!-- Automatically expand WAR files and EAR files -->
    <applicationManager autoExpand="true" startTimeout="15m"/>

     <webContainer extractHostHeaderPort="true" trustHostHeaderPort="true"/>   
     <applicationMonitor dropinsEnabled="false" updateTrigger="mbean"/>
     <config updateTrigger="mbean"/>
     <applicationMonitor updateTrigger="mbean"/>

    <!-- 
    <keyStore id="opTestKeyStore" location="\resources\security/mytruststore.jks" type="JKS" 
     password="keystorePwd" />
    <openidConnectProvider id="OAuthConfigSample" oauthProviderRef="OAuthConfigSample" 
     signatureAlgorithm="RS256" keyStoreRef="opTestKeyStore" keyAliasName="myOpKeyAlias" />
     -->

     <keyStore id="defaultKeyStore" password="${keystore_password}"/>
     <ssl id="oidcClientSSL" keyStoreRef="defaultKeyStore" trustDefaultCerts="true"/>

      <openidConnectClient authFilterid="myAuthFilter" 
      authorizationEndpointUrl="${APP_ID_OAUTH_SERVER_URL}/authorization" 
      clientId="${APP_ID_CLIENT_ID}" clientSecret="${APP_ID_CLIENT_SECRET}" id="MyRP" 
      issuerIdentifier="${APP_ID_OAUTH_SERVER_URL}" 
      jwkEndpointUrl="${APP_ID_OAUTH_SERVER_URL}/publickeys" 
          redirectToRPHostAndPort="https://localhost:9443/ne/" signatureAlgorithm="RS256" 
       tokenEndpointAuthMethod="basic" tokenEndpointUrl="${APP_ID_OAUTH_SERVER_URL}/token"/>
 
      <logging consoleLogLevel="INFO" logDirectory="${application.log.dir}"/>

      <!--  <webApplication id="ne" location="ne-1.0.0-BUILD-SNAPSHOT.war" name="ne"/>-->

       <webApplication id="ne" location="ne-1.0.0-BUILD-SNAPSHOT.war" name="ne"/>
       </server>
data_henrik
  • 16,724
  • 2
  • 28
  • 49
  • What is configured in App ID as redirect URI? How is your application set up, how is it bound? – data_henrik Aug 27 '21 at 04:58
  • Two points from me: 1. As @data_henrik pointed out, did you set up your redirect urls correctly? You can set `http://localhost:9443/*` 2. Can you run a sample app and see if that works locally? You can generate one from the landing page of the dashboard. These sample applications are correctly configured and ready to use. If the sample app doesn't work, it means there is an issue with your local env. If it does, please double check your integration – Vladimir Atanasov Aug 27 '21 at 11:38
  • Hi @data_henrik, for localhost we have configured 'https://localhost:9443/ne/oidcclient/redirect/MyRP' this url as redirect uri and there is no redirect uri issue as AppId login page is coming – Comrade Bansu Aug 27 '21 at 13:00
  • Hi @Vladimir Atanasov, yes we have setup the correct redirect url in Appid. Also i have run the same codebase with appid configuration in Cloud instance where Appid is working very well but it is not working on localhost. And in logs also there is no error coming. – Comrade Bansu Aug 27 '21 at 13:09
  • 1. Add that info to the question. 2. There is a diff between "https://localhost..." and just "localhost...". Is your localhost reachable via https as shown in your URI in the question? – data_henrik Aug 27 '21 at 13:36
  • I have the same issue, even though the localhost is added to the Redirect URl list. Any updates from your side? – Amr Ellafy Dec 30 '21 at 10:36

0 Answers0