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

feat(auth): OAuth/PCKE callers #470

Closed
wants to merge 1 commit into from
Closed

Conversation

Integralist
Copy link
Collaborator

@Integralist Integralist commented Sep 4, 2023

In a future world, callers (such as the Fastly CLI) will authenticate using OAuth (specifically the PKCE extension flow) and so the token that is provided will need to be used with the Authentication HTTP request header.

@@ -54,6 +55,7 @@ func (c *Client) RawRequest(verb, p string, ro *RequestOptions) (*http.Request,
// Set the API key.
if len(c.apiKey) > 0 {
request.Header.Set(APIKeyHeader, c.apiKey)
request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", c.apiKey))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be c.apiKey? That would set the value of the bearer to the API token and not the desired OAuth JWT access_token,

@Integralist
Copy link
Collaborator Author

@phamann I've pinged you internally to explain my thought process. I'm going to close this PR as I think it's premature.

@Integralist Integralist closed this Nov 9, 2023
@Integralist Integralist deleted the integralist/bearer branch November 9, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants