Skip to content

Support more auth endpoints - #3

Closed
v-braun wants to merge 3 commits into
cli:mainfrom
v-braun:main
Closed

v-braun wants to merge 3 commits into
cli:mainfrom
v-braun:main

Conversation

@v-braun

@v-braun v-braun commented Jan 22, 2021

Copy link
Copy Markdown

Hi,

this is a draft to support other endpoints than GitHub.

In my specific case, I had to use Microsofts Auth Endpoint wich is a bit different than that from GitHub.
See details here.

I needed the support of additional post parameters in the AccessToken function and also to handle JSON based responses.

My solution is not that generic (to support others) as I wanted, because I had to focus on my specific case but maybe it is a good starting point for other auth endpoints.

@mislav mislav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi, thank you for the contribution!

  1. Could you tell us more about the specifics of the host you are trying to authenticate to? Which extra endpoints/parameters were needed?
  2. Could the added functionality be described by tests?
  3. Could you take care of linter failures?

Thank you.

@v-braun

v-braun commented Feb 3, 2021 •

Copy link
Copy Markdown
Author

@mislav I see already that there are some tests failing (not only linter tests).

I am working on a GO based desktop app based on wails.
Within the app I am authenticating against office365 wich has some differences to GitHub within the open ID protocol details.

1.: I have to specify additional query parameters within the browser URL browser.OpenURL wich are:

"response_type": "code",
"response_mode": "query"

see details here

2.: flow.AccessToken need in my case some additional parameters that has to been posted, this are:

"grant_type":  "authorization_code",
"redirect_uri": "redirect url",

see details here

3.: api.PostForm handle payload that is provided via a JSON content type.
O365 response is a JSON.
For that I analyze the contentype ad parse a dictionary based on this.
FormResponse.Get has a check and returns the accesstoken (and refreshtoken) based on the previouse received ContentType (see here).

Please see this as a working draft, we can also close the PR til I have refactored the code and fixed the Tests.
I am right now busy on my project but hopefully can contribute here again till end of this week.

Hallay16

This comment was marked as spam.

@williammartin

Copy link
Copy Markdown
Member

This seems incredibly stale so I'm going to go ahead and close this to get it off our books 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants