Skip to content

Bug: Redirect URI mismatch when attempting to complete login flow #13

@wyze

Description

@wyze

Bug: Redirect URI mismatch when attempting to complete login flow

Summary

The incoming url in the below snippet may not match the correct protocol when using a reverse proxy (ALB). This in turn causes an issue when verifying the token as the URL created doesn't match what was supplied to redirect_uri.

>(createRouteUrl(c.req.url, baseURL), c);

Expected Behavior

The login interaction is able to complete and the user is logged in.

Actual Behavior

An error is thrown because the redirect_uri doesn't match what was supplied when initiating the login flow.

Impact

  • Users are unable to login.

Suggested Fix

Either:

  1. Use just the pathname as the first argument, c.req.path vs c.req.url
    • Writing this ticket, dawned on me, there could be search params, so we would want path + search params
  2. Ensure the c.req.url protocol matches the baseUrl protocol

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