0

Initially I have setup microservice application with oauth2 and keycloak. I was able to do that successfully. I have added all things such as SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI, SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI, SECURITY_OAUTH2_CLIENT_CLIENT_ID, SECURITY_OAUTH2_CLIENT_CLIENT_SECRET, SECURITY_OAUTH2_CLIENT_SCOPE, SECURITY_OAUTH2_RESOURCE_USER_INFO_URI. I have jhipster registry running and gateway application running. I have created a application in okta with the openidconnect type application. Screen shot is mentioned below. I able to see the http://localhost:8080. Upon clicking on sign in button I getting the below error.

app1app2app3app4app5app6error

2 Answers2

1

If you look in your browser’s address bar on the 400 error page, you’ll see it has “http://localhost:8080/login” as the redirect URI. Add this value to the Login redirect URIs in your Okta app and you should be good to go.

Matt Raible
  • 8,187
  • 9
  • 61
  • 120
  • Thanks for the response. I have added as you said, but its redirecting to login page but not signing into application. My requirement is, upon clicking on the application(once the user is assigned this app), as he has already authenticated from okta, upon clicking the application he should see the home page – Satyanvesh Muppaneni Nov 11 '18 at 03:49
  • FYI, following are my env variable in app.yml - SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI=https://dev-558029.oktapreview.com/oauth2/default/v1/token - SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI=https://dev-558029.oktapreview.com/oauth2/default/v1/authorize - SECURITY_OAUTH2_CLIENT_CLIENT_ID=0oah8azcnaz2GunyT0h7 - SECURITY_OAUTH2_CLIENT_CLIENT_SECRET= D5j6vS_eNT3G56jN81riyV8w9rbxuQZph7L2wfgk - SECURITY_OAUTH2_CLIENT_SCOPE=openid profile email - SECURITY_OAUTH2_RESOURCE_USER_INFO_URI=https://dev-558029.oktapreview.com/oauth2/default/v1/userinfo – Satyanvesh Muppaneni Nov 11 '18 at 03:57
  • In okta app the login redirect uri is : http://localhost:8080/login Initiate login uri is : http://localhost:8080 – Satyanvesh Muppaneni Nov 11 '18 at 04:00
0

Thanks, I solved the issue. The solution was, The user with which i was trying to login was not created in users table. For that I have created another user in okta and assigned the roles to it. Reset the password and tried logging to account. Upon invoking "http://localhost:8080" and clicking on "sign in" button it redirected to okta login page and logged in with the above created user and it redirected me to home page of my gateway.

Thank you