ory / ory/kratos-client-java

Deserialization bug when running toSession for social sign in cookie?

Open
#13 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
8
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
Ory Network Project

No response

Describe the bug

I've been using social sign in with Azure AD successfully for some time, but there now seems to be a problem when trying to verify the users that are signed in using Azure. This problem might have been there for a long time, because this feature has not been used much in our system.

Reproducing the bug

Steps to reproduce the behaviour:

  1. Register a Microsoft tenant for social sign-in with scopes: email, profile. tenant: organization. subject source: userinfo.
  2. Try to log in with a tenant of your choice.
  3. Try to validate the session with the SDK: frontendApi.toSession(null, cookie)
Relevant log output
java.lang.IllegalArgumentException: The field `provider` in the JSON string is not defined in the `SessionAuthenticationMethod` properties. JSON: {"method":"oidc","aal":"aal1","completed_at":"2023-08-08T13:06:43.107679019Z","provider":"microsoft"}
Relevant configuration

No response

Version

0.13.1

On which operating system are you observing this issue?

macOS

In which environment are you deploying?

Ory Network

Additional Context

This was working before. At first I thought the problem was with me not having updated the kratos-client-java version for a long time, but upgrading to 0.13.1 did not do the trick.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at frontendApi.toSession(null, cookie) and trace deserialization of the SessionAuthenticationMethod response shown in the report. Reproduce the Azure social sign-in flow with version 0.13.1; done means session validation accepts the returned provider field without throwing IllegalArgumentException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.