Skip to content

The additionalParameters array parameter of OAuth2AuthorizationRequest causes the authorizationRequestUri to be incorrect #15468

Closed
@chenzhenjia

Description

@chenzhenjia

Describe the bug
The additionalParameters array parameter of OAuth2AuthorizationRequest causes the authorizationRequestUri to be incorrect

To Reproduce
Access the spring authorization server http://127.0.0.1:3000/oauth2/authorize?scope=openid%20profile&client_id=xx&response_type=code&state=12345&test=1&test=2
java code:

    OAuth2AuthorizationRequest authorizationRequest = OAuth2AuthorizationRequest.authorizationCode()
        .authorizationUri(authorizationCodeRequestAuthentication.getAuthorizationUri()) // http://127.0.0.1:3000/oauth2/authorize
        .clientId(registeredClient.getClientId()) //xxx
        .redirectUri(authorizationCodeRequestAuthentication.getRedirectUri())
        .scopes(authorizationCodeRequestAuthentication.getScopes())
        .state(state)
        .additionalParameters(authorizationCodeRequestAuthentication.getAdditionalParameters()) // map: {"test":["1","2"]}
        .build();
  authorizationRequest.getAuthorizationRequestUri() // http://127.0.0.1:3000/oauth2/authorize?response_type=code&client_id=xx&scope=openid%20profile&state=12345&test=%5BLjava.lang.String;@14ec7490

http://127.0.0.1:3000/oauth2/authorize?response_type=code&client_id=xx&scope=openid%20profile&state=12345&test=%5BLjava.lang.String;@14ec7490
The parameter test is wrong

Expected behavior
http://127.0.0.1:3000/oauth2/authorize?response_type=code&client_id=xx&scope=openid%20profile&state=12345&test=1&test=2

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: duplicateA duplicate of another issuetype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions