@@ -32,10 +32,9 @@ import org.apache.commons.codec.binary.Base64
3232import org.grails.plugins.codecs.URLCodec
3333import org.pac4j.core.client.IndirectClient
3434import org.pac4j.core.context.CallContext
35- import org.pac4j.core.context.WebContext
3635import org.pac4j.core.exception.http.RedirectionAction
3736import org.pac4j.jee.context.JEEContext
38- import org.pac4j.jee.context.session.JEESessionStore
37+ import org.pac4j.jee.context.session.JEESessionStoreFactory
3938import org.springframework.http.HttpStatus
4039import org.springframework.security.core.userdetails.User
4140
@@ -64,8 +63,6 @@ class RestOauthController {
6463 */
6564 def authenticate (String provider , String callback ) {
6665 IndirectClient client = restOauthService. getClient(provider)
67- WebContext context = new JEEContext (request, response)
68-
6966 if (callback) {
7067 try {
7168 if (Base64 . isBase64(callback. getBytes())){
@@ -78,7 +75,8 @@ class RestOauthController {
7875 }
7976 }
8077
81- RedirectionAction redirectAction = client. getRedirectionAction(context, JEESessionStore . INSTANCE ). get()
78+ RedirectionAction redirectAction = client. getRedirectionAction(new CallContext (new JEEContext (request, response),
79+ JEESessionStoreFactory . INSTANCE . newSessionStore(null ))). get()
8280 log. debug " Redirecting to ${ redirectAction.location} "
8381 redirect url : redirectAction. location
8482 }
@@ -89,7 +87,8 @@ class RestOauthController {
8987 * frontend application can store the REST API token locally for subsequent API calls.
9088 */
9189 def callback (String provider ) {
92- CallContext context = new CallContext (new JEEContext (request, response), null )
90+ CallContext context = new CallContext (new JEEContext (request, response),
91+ JEESessionStoreFactory . INSTANCE . newSessionStore(null ))
9392 def frontendCallbackUrl
9493 if (session[CALLBACK_ATTR ]) {
9594 log. debug " Found callback URL in the HTTP session"
0 commit comments