2

I finally bow to the Internet forces and am switching my public-facing Grails application from email based registration/verification to OpenID Connect (Github/Google/Microsoft). The app is running for eight years and was recently upgraded to Grails 5.1 and uses Spring Security.

A couple of years ago i got the Google integration working with some Oauth plugin (grails-spring-security-openid?) but that was under an older version of Grails. The latest version of the Spring-Security-Core plugin still runs fine under Grails 5 but the development of those Oauth plugins seem to have stopped a couple of years ago. Some of the plugins i have beem looking at are:

My real question is ‘How to do OpenID Connect in Grails 5’ but the following points are more specific and show I have already done some work on this ;):

  • Is there a Grails plugin that would give me a fighting chance to implement OpenID Connect in Grails 5 using Spring Security.
  • Can the non-Grails org.springframework.boot.spring-boot-starter-oauth2-client plugin be used in a Grails 5 app.
  • If there is no such plugin, is it possible to delegate the OpenID Connect-procedure to a different framework running on the same machine and continue with the acquired credentials in the Grails 5 app (a sort of single-signon).
Jan
  • 808
  • 8
  • 19

1 Answers1

1

To answer my own question, i have not found acceptable Grails plugins that implement OpenID Connect in Grails 5. I am now coding OpenID Connect support for Google and Microsoft in the application without using a plugin. It is not to difficult and only requires a redirect followed by one or two REST calls. Grails-spring-security will still be used for the User model, access control and remember-me support.

Sample code can be found in https://github.com/Janvanoorschot/openidconnect.

Updated dec 2022: I added a Python/Flask project demonstrating the same functionality as the Grails project.

Jan
  • 808
  • 8
  • 19
  • Hi, wondering if you had a sample app of this integration. I'm in the process of trying to integrate OpenID in to a Grails 5 app and would love where to start with it all. I have a Keycloak server up but needed assistance moving from our regular spring security core login flow to using Keycloak. – Dharmesh Patel Oct 10 '22 at 18:18
  • @DharmeshPatel I saw you cloned the openidconnect repo. Did you find it usefull. If so could you 'up' thjis answer so other people can find it? – Jan Oct 17 '22 at 12:21