Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIDC state cookie cannot be read by another JVM in collective w/socal login TS004966274 #15987

Closed
barbj opened this issue Feb 19, 2021 · 1 comment · Fixed by #16150
Closed
Labels
bug This bug is not present in a released version of Open Liberty release:21004 team:Security SSO

Comments

@barbj
Copy link
Member

barbj commented Feb 19, 2021

Describe the bug
[2/15/21 2:32:56:282 CST] 00000072 OIDCClientAut E CWWKS1745E: The WASOidcCode cookie [ITSASTRING_1xtpZwgG8vF7d0XMeAEvBmeGzPAegfSptO4GP72tObA=] in the request to the OpenID Connect client [xxx] is not valid. Its value might have been modified.

Steps to Reproduce

  1. Configure OIDC with the socialLogin-1.0 feature (oidcLogin) in a collective w/o session affinity
  2. Initial request goes to JVM1
  3. Callback from OP goes to JVM2
  4. JVM2 fails to validate the state cookie and the login fails

Expected behavior
JVM2 can read and process the state cookie

Diagnostic information:

  • OpenLiberty Version: 21.0.0.1
  • Java Version:
  • server.xml configuration:
    <oidcLogin id="w3id_oidc_auth" displayName="w3_OIDC_Login" clientId="xxx" clientSecret="xxx" authorizationEndpoint="https://login.com/oidc/endpoint/default/authorize" tokenEndpoint="https://login.com/oidc/endpoint/default/token" jwksUri="https://login.com/oidc/endpoint/default/jwks" issuer="https://login.com/oidc/endpoint/default" scope="openid profile email" userNameAttribute="email" authFilterRef="w3_oidcAuthFilter"/>

Additional information:
This issue was reported with OIDC configured via social login (oidcLogin). This does not happen with the OIDC RP configured via the openidConnectClient-1.0 feature (openidConnectClient).

Trace snip:
[2/15/21 2:32:56:282 CST] 00000072 OIDCClientAut > validateReqParameters Entry
com.ibm.ws.security.social.internal.OidcLoginConfigImpl@1b36348e
{}
ITSASTRING_1xtpZwgG8vF7d0XMeAEvBmeGzPAegfSptO4GP72tObA=
[2/15/21 2:32:56:282 CST] 00000072 OidcClientUti > calculateOidcCodeCookieValue Entry
ITSASTRING
com.ibm.ws.security.social.internal.OidcLoginConfigImpl@1b36348e
[2/15/21 2:32:56:282 CST] 00000072 Oauth2LoginCo > getClientSecret Entry
[2/15/21 2:32:56:282 CST] 00000072 Oauth2LoginCo < getClientSecret Exit
<sensitive java.lang.String@b184e960>
[2/15/21 2:32:56:282 CST] 00000072 Oauth2LoginCo > getClientSecret Entry
[2/15/21 2:32:56:282 CST] 00000072 Oauth2LoginCo < getClientSecret Exit
<sensitive java.lang.String@b184e960>
[2/15/21 2:32:56:282 CST] 00000072 OidcClientUti < calculateOidcCodeCookieValue Exit
ITSASTRING_aTT7rHRKFKpjpcYIuXS9bk+9AvDUbdWBZxwgfICnDVo=
[2/15/21 2:32:56:282 CST] 00000072 OIDCClientAut 3 The value for the OIDC state cookie [WASOidcCode] failed validation.
[2/15/21 2:32:56:282 CST] 00000072 OIDCClientAut < validateReqParameters Exit
false
[2/15/21 2:32:56:282 CST] 00000072 ProviderAuthe > Entry
SEND_401
401
[2/15/21 2:32:56:282 CST] 00000072 ProviderAuthe < Exit
com.ibm.ws.webcontainer.security.ProviderAuthenticationResult@f775020f
[2/15/21 2:32:56:282 CST] 00000072 Oauth2LoginCo > getClientId Entry
[2/15/21 2:32:56:282 CST] 00000072 Oauth2LoginCo < getClientId Exit
YmFiYWZhMzQtNzJkMC00
[2/15/21 2:32:56:282 CST] 00000072 OIDCClientAut E CWWKS1745E: The WASOidcCode cookie [ITSASTRING_1xtpZwgG8vF7d0XMeAEvBmeGzPAegfSptO4GP72tObA=] in the request to the OpenID Connect client [xxx] is not valid. Its value might have been modified.

@barbj barbj added bug This bug is not present in a released version of Open Liberty team:Security SSO labels Feb 19, 2021
@barbj
Copy link
Member Author

barbj commented Mar 4, 2021

@ayoho The cookie fix worked, so this is ready to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This bug is not present in a released version of Open Liberty release:21004 team:Security SSO
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant