Skip to content

Dot com sign in - #639

Merged
niik merged 45 commits into
masterfrom
dot-com-sign-in
Nov 18, 2016
Merged

niik merged 45 commits into
masterfrom
dot-com-sign-in

Conversation

@joshaber

@joshaber joshaber commented Nov 15, 2016 •

Copy link
Copy Markdown
Contributor

Sign in via basic auth.

Fixes the dot com side of #56.

@mtodd

mtodd commented Nov 15, 2016

Copy link
Copy Markdown

@joshaber I assume you also intend to support token auth, right?

@joshaber

Copy link
Copy Markdown
Contributor Author

I assume you also intend to support token auth, right?

If I understand you right, that's what we're doing here. We use basic auth to create an authorization using https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization. Then we use the created token going forward.

I said "basic auth" in the body to distinguish it from the OAuth web flow, which we also support.

@mtodd

mtodd commented Nov 15, 2016

Copy link
Copy Markdown

@joshaber awesome. Apologies for not looking too closely at the diff & what you're building on, "Basic Auth" threw me off.

I'm mainly thinking about how Orgs SAML SSO flow will work here (RE: https://github.com/github/identity/issues/122#user-content-api-git). https://github.com/github/platform-iam/pull/50 obviously has these concerns raised from the client application perspective already.

❤️

@joshaber

Copy link
Copy Markdown
Contributor Author

No worries, I appreciate you thinking of us!

@joshaber

Copy link
Copy Markdown
Contributor Author

🍊

Comment thread app/src/lib/api.ts Outdated
/** The note used for created authorizations. */
function getNote(): string {
return `GitHub Desktop on ${OS.hostname()}`
function getNote(login: string): string {

This comment was marked as spam.

This comment was marked as spam.

@joshaber

Copy link
Copy Markdown
Contributor Author

🛣

@joshaber joshaber mentioned this pull request Nov 17, 2016
@niik

niik commented Nov 18, 2016

Copy link
Copy Markdown
Member

Why are we not persisting the fingerprint any more? Wouldn't it make a lot of sense to persist it on a per machine level?

@joshaber

Copy link
Copy Markdown
Contributor Author

The fingerprint doesn't seem to serve a purpose anymore, besides uniquely identifying authorization requests. Since you can no longer fetch a token based on its fingerprint, there's no reason to save it.

@niik

niik commented Nov 18, 2016

Copy link
Copy Markdown
Member

The fingerprint doesn't seem to serve a purpose anymore, besides uniquely identifying authorization requests. Since you can no longer fetch a token based on its fingerprint, there's no reason to save it.

I thought a new token with the same fingerprint would automatically revoke any previous token with that fingerprint. Such that signing in twice with the same fingerprint would automatically revoke any previous tokens created on that particular user/machine combination. Is that no longer the case or has it never been the case outside of my head?

@joshaber

Copy link
Copy Markdown
Contributor Author

I thought a new token with the same fingerprint would automatically revoke any previous token with that fingerprint. Such that signing in twice with the same fingerprint would automatically revoke any previous tokens created on that particular user/machine combination. Is that no longer the case or has it never been the case outside of my head?

That wasn't the case in testing. I'd get a 422 if I tried to create a new authorization with an existing fingerprint. From a naive look at the code (here and here) it looks like it's just a uniqueness constraint.

@niik

niik commented Nov 18, 2016

Copy link
Copy Markdown
Member

That wasn't the case in testing. I'd get a 422 if I tried to create a new authorization with an existing fingerprint. From a naive look at the code (here and here) it looks like it's just a uniqueness constraint.

Huh, I could have sworn that was the case when we did this for GHfW. Guess I was wrong.

@niik
niik merged commit 685fd55 into master Nov 18, 2016
@niik
niik deleted the dot-com-sign-in branch November 18, 2016 16:03
@joshaber

Copy link
Copy Markdown
Contributor Author

At one point we used the get-or-create endpoint to re-use an existing authorization if possible. But now that you cannot get a full token back from there, we have to unconditionally create a new authorization. At least that was the progression of things on the Mac side.

mijiang168 pushed a commit to mijiang168/desktop that referenced this pull request Apr 22, 2022
mijiang168 pushed a commit to mijiang168/desktop that referenced this pull request Apr 22, 2022
yasuking0304 pushed a commit to yasuking0304/desktop that referenced this pull request Jan 22, 2023
yasuking0304 pushed a commit to yasuking0304/desktop that referenced this pull request Jan 22, 2023
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.

3 participants