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

Fix user information to include payload returned from identity provider #2890

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

hugobarauna
Copy link
Member

A user is trying to get identity information from their ZTA provider (Cloudflare, in this case) inside a Livebook app.

Livebook was supposed to put that information inside the payload field of the user struct, but this was not happening.

So, when running Kino.Workspace.app_info() from inside a Livebook multi-session app, this was being returned:

Kino.Workspace.info
%{
  type: :multi_session,
  started_by: %{
    id: "239d3f11-f27c-5de4-bbf7-a8d013e8957e",
    name: "Jake Peralta",
    source: :zta,
    payload: nil,
    email: "[email protected]"
  }
}

Notice how payload was nil. ☝️

With this PR, this is now being returned:

Kino.Workspace.info
%{
  type: :multi_session,
  started_by: %{
    id: "239d3f11-f27c-5de4-bbf7-a8d013e8957e",
    name: "Jake Peralta",
    source: :zta,
    payload: %{
      "aud" => ["a8455c4c579173c8f0cc1fc010f740df3f1ccc7209ef32"],
      "country" => "US",
      "email" => "[email protected]",
      "exp" => 17334,
      "iat" => 17334,
      "identity_nonce" => "Ye7i5ZHbI",
      "iss" => "https://99.cloudflareaccess.com",
      "nbf" => 1733488,
      "sub" => "239d3f11",
      "type" => "app"
    },
    email: "[email protected]"
  }
}

Copy link

github-actions bot commented Dec 6, 2024

Uffizzi Preview deployment-58894 was deleted.

@jonatanklosko jonatanklosko changed the title Fix: user payload was always nil Fix user information to include payload returned from identity provider Dec 6, 2024
@jonatanklosko jonatanklosko merged commit 2d9b6f8 into main Dec 6, 2024
7 checks passed
@jonatanklosko jonatanklosko deleted the hb-fix-user-payload-nil branch December 6, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants