Add Social Login to Secure Your Spring Boot App

Add Social Login to Secure Your Spring Boot App

This post shows you how to add social login to your JHipster applications.

Armel Hyacinthe BobZy

You rock! Thank you very much for this post.

Tuhin Mandal

Hi Andrew, I was trying to use jhipster 6 but somehow it is not working, hence fell back to 5.8 and followed this guide exactly.I have done custom url part, and my app is on https://login.do-rea.com. I was able to edit the sign in screen etc, when I launch my app on localhost, click sign in, it perfectly moving to the okta hosted login screen. However, once I login, I get 401.
I have couple of doubts here:

1.Custom URL (https://login.do-rea.com/oa… → This is what okta assigned after I added custom domain, if I hit this URL on browser it gives 404

2. user-info-uri: https://dev-401476-okta.com… [which I added on application.yaml, this URL actually does not exist]

What am I doing wrong ?

Matt Raible

The first URL is an issuer, and it’s not accessible directly. If you tack on .well-known/openid-configuration, it does work. For social auth, I believe you only need the authorization_endpoint.

As for the second URL, you need a dot before “okta.com” rather than a dash. Also, you can’t hit this URL directly in a browser or you’ll get a 400. You need an access token to access it.

Tuhin Mandal

Ah! Thanks Matt. Correcting access_token_uri and user_info_uri did the trick. It’s working now. The URL should contain .okta.com.

I will make it work with Jhipster 6.