Changes were detected from the original authorization request. | ORIGINAL_AUTHORIZATION_REQUEST_ATTR_NAME| Oauth2 Migration

33 views Asked by At

I have been migrating my old oauth2 repo for authentication from SpringBoot(1.3.3RELEASE to 2.5.2) and SpringSecurity(4.0.1 to 5.5.2) and facing some issues. When I try to authenticate the request from my app to "/oauth/authorize" post endpoint, its failing with the error as "Changes were detected from the original authorization request." because of missing ORIGINAL_AUTHORIZATION_REQUEST_ATTR_NAME in the model map.

Please refer below the code snippet where its failing. The class is AuthorizationEndpoint.java inside spring-security-oauth2-2.3.4.RELEASE.jar

/ Check to ensure the Authorization Request was not modified during the user approval step
        @SuppressWarnings("unchecked")
        Map<String, Object> originalAuthorizationRequest = (Map<String, Object>) model.get(ORIGINAL_AUTHORIZATION_REQUEST_ATTR_NAME);
        if (isAuthorizationRequestModified(authorizationRequest, originalAuthorizationRequest)) {
            throw new InvalidRequestException("Changes were detected from the original authorization request.");
        }

Please help me understand how to proceed here. Also i tried searching for a migration guide but couldn't find much information, if someone knows or have any migration guide for oauth2 from Spring Security 4x to 5x , that would be really helpful.

0

There are 0 answers