Skip to content

Commit b257b76

Browse files
fix: JEESessionStore.INSTANCE does not exist
1 parent 64795cd commit b257b76

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

plugin-rest/spring-security-rest/grails-app/controllers/grails/plugin/springsecurity/rest/RestOauthController.groovy

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ import org.apache.commons.codec.binary.Base64
3232
import org.grails.plugins.codecs.URLCodec
3333
import org.pac4j.core.client.IndirectClient
3434
import org.pac4j.core.context.CallContext
35-
import org.pac4j.core.context.WebContext
3635
import org.pac4j.core.exception.http.RedirectionAction
3736
import org.pac4j.jee.context.JEEContext
38-
import org.pac4j.jee.context.session.JEESessionStore
37+
import org.pac4j.jee.context.session.JEESessionStoreFactory
3938
import org.springframework.http.HttpStatus
4039
import 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

Comments
 (0)