Skip to content

Support Non-URL redirection URIs (e.g., for native apps with custom schemes) #1542

Closed
@victorbalssa

Description

@victorbalssa

I'm currently working on mobile native application which use OAuth2 flow with laravel/passport.

The redirection URI is something like scheme://home-dashboard, which is a valid URI but is not a URL.

The RedirectRule accept multiple URLs but does not accept URIs like scheme://home-dashboard.

https://github.com/laravel/passport/blob/10.x/src/Http/Rules/RedirectRule.php:

/**
 * {@inheritdoc}
 */
public function passes($attribute, $value)
{
    foreach (explode(',', $value) as $redirect) {
        $validator = $this->validator->make(['redirect' => $redirect], ['redirect' => 'url']);

        if ($validator->fails()) {
            return false;
        }
    }

    return true;
}

Do you think that I can create a PR to support the URI scheme as well?

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