Skip to content

Feature Request: Support for Custom Authorization Parameters #4

@oschrenk

Description

@oschrenk

Problem

It seems ortie does not support query parameters in authorization endpoint URL. That prohibits getting a refresh token from Google.

But AFAIU Google requires additional parameters to enable refresh token support.

Where the issue occurs:

In src/auth/get.rs:80-81, ortie replaces the entire query string with default values

uri.set_query(Some(&request_params.to_form_url_encoded_string()));

So even if I try to set

  endpoints.authorization = "https://accounts.google.com/o/oauth2/auth?access_type=offline&prompt=consent"

those parameters get stripped away

But.... f

From https://developers.google.com/identity/protocols/oauth2/web-server:

The refresh token is only returned if your application set the access_type parameter to offline in the initial request to Google's authorization server.
Additionally, if the user has previously authorized the application, you need prompt=consent to force re-authorization and receive a new refresh token.

I had claude code change the code to inject these extra query params via a toml configuration. It works for me (I now get a refresh token) but since it's all AI I rather not make that a PR.

Thoughts?

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