Skip to content

flow fails when we open second tab. owerwritting state in session #553

@emil191995

Description

@emil191995

When I open 2 tabs this way I opened first tab then opened second tab after returned first tab and tried to sign in flow is failing cos second tab overwrote state of first tab in session I did some debugging and I think we can make state as table
store state in the session

  session:set("state", state)
  session:set("nonce", nonce)
  session:set("original_url", target_url)
  session:set("code_verifier", code_verifier)
  session:set("last_authenticated", ngx.time())

replace with following

local states = session:get("oidc_states") or {}
  states[state] = {
    nonce = nonce,
    code_verifier = code_verifier,
    created_at = ngx.time()
  }
  session:set("oidc_states", states)
  session:set("original_url", target_url)
  session:set("last_authenticated", ngx.time())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions