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

Sign In with Apple support #110

Closed
CetinSert opened this issue Jun 17, 2019 · 13 comments
Closed

Sign In with Apple support #110

CetinSert opened this issue Jun 17, 2019 · 13 comments

Comments

@CetinSert
Copy link

https://developer.apple.com/sign-in-with-apple/

  1. Is this new authentication API easy to integrate into authn-server?
  2. Is there any work happening on this front?

@cainlevy

@cainlevy
Copy link
Member

@CetinSert Yes, my first impression is that Sign In with Apple uses a standard OAuth flow and should be simple to integrate into authn-server. I'm not aware of anyone working on it yet.

Integrating an OAuth provider into authn-server involves:

  • adding configuration for the integration (example]
  • implementing the Provider interface, mostly to fetch the authenticated user's ID and email (example)

@CetinSert
Copy link
Author

@cainlevy

https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple#create-a-private-key-for-client-authentication

Does this clarify any questions for development?

I would love to take time and send you weekly PRs for each oauth2 provider available in https://godoc.org/golang.org/x/oauth2#pkg-subdirectories but not yet in authn-server.

I am not sure I can start with Sign In with Apple right off the bat though. I need your assesment on how far it differs from existing oauth2 clients (both authn-server and golang.org/x/oauth2/* ones).

@cainlevy
Copy link
Member

cainlevy commented Jun 19, 2019

Interesting. AuthN currently assumes that the client secret can be generated on startup. We'll need to update the oauth.Provider interface to allow for dynamic configuration so that we can create the JWT per request.

It's nice that the returned access token contains an ID token with the user ID. It looks like there's no way to fetch an email though. For now we can probably "cheat" by creating a fake email from the user ID so that the account creation validations don't need any modification.

All in all, it looks doable but with at least one complication that other oauth2 clients would not have.

@CetinSert
Copy link
Author

I believe the reason they do not provide a static email as directly is because apple wants to provide a unique email per app or perhaps per login to keep user's email address private. This was a much appreciated feature when they first announced Sign In with Apple a few weeks / days ago.

@cainlevy
Copy link
Member

Yeah, that's neat! It just looks like there's no way to discover the email address yet.

@CetinSert
Copy link
Author

CetinSert commented Sep 4, 2019

With https://github.com/golang/oauth2/pull/386/files#diff-ae789e93466cc0fcd954b362b667fec6 now defined, what needs to be done is just a provider file for your project, right?

@CetinSert
Copy link
Author

id_token in https://developer.apple.com/documentation/signinwithapplerestapi/tokenresponse
contains the user ID which is a unique or real email address.

@CetinSert
Copy link
Author

@cainlevy can you review the last two comments above?

@cainlevy
Copy link
Member

cainlevy commented Sep 5, 2019

@CetinSert nice, looks ready

@AlexCuse
Copy link
Contributor

I think the upstream PR got lost in gerrit-land on this one, I can try to resubmit but any concern about defining an endpoint internally in the interim if this one is pursued @cainlevy

@AlexCuse
Copy link
Contributor

This PR will enable defining provider-specific signing keys as part of the configured credentials and should unblock future work here #236

@AlexCuse
Copy link
Contributor

AlexCuse commented Feb 3, 2024

Think I'm pretty close to having a PR ready for this. Will be based on this branch #241

Came across this doc with some of the rough edges in Apple's implementation that seemed worth including here for posterity https://bitbucket.org/openid/connect/src/master/How-Sign-in-with-Apple-differs-from-OpenID-Connect.md#markdown-header-peculiarities

AlexCuse added a commit to AlexCuse/authn-server that referenced this issue Feb 3, 2024
AlexCuse added a commit to AlexCuse/authn-server that referenced this issue Feb 4, 2024
AlexCuse added a commit to AlexCuse/authn-server that referenced this issue Mar 20, 2024
AlexCuse added a commit to AlexCuse/authn-server that referenced this issue Mar 22, 2024
AlexCuse added a commit to AlexCuse/authn-server that referenced this issue Mar 24, 2024
AlexCuse added a commit to AlexCuse/authn-server that referenced this issue Mar 25, 2024
Implements an oauth provider for sign-in with apple. Requires some
additional flexibility in oauth credentials / providers:

- Include a map of additional data in credentials.
- Allow providers to override secrets - configured secret in apple
credentials is a private key used to sign a dynamically calculated
secret - in this case a JWT that includes additional data as claims.
- Allow providers to accept returns as HTTP POST instead of GET.
- Allow providers to add additional oauth options to authorization
request.
AlexCuse added a commit to AlexCuse/authn-server that referenced this issue Mar 26, 2024
Implements an oauth provider for sign-in with apple. Requires some
additional flexibility in oauth credentials / providers:

- Include a map of additional data in credentials.
- Allow providers to override secrets - configured secret in apple
credentials is a private key used to sign a dynamically calculated
secret - in this case a JWT that includes additional data as claims.
- Allow providers to accept returns as HTTP POST instead of GET.
- Allow providers to add additional oauth options to authorization
request.
AlexCuse added a commit to AlexCuse/authn-server that referenced this issue Mar 27, 2024
Implements an oauth provider for sign-in with apple. Requires some
additional flexibility in oauth credentials / providers:

- Include a map of additional data in credentials.
- Allow providers to override secret behavior - configured secret in
apple credentials is a private key used to sign a secret calculated
at runtime, in this case a JWT that includes additional data as claims.
- Allow providers to accept returns as HTTP POST instead of GET.
- Allow providers to add additional oauth options to authorization
request.
@AlexCuse
Copy link
Contributor

AlexCuse commented Apr 4, 2024

This is available in v1.19.0

https://github.com/keratin/authn-server/releases/tag/v1.19.0

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

No branches or pull requests

3 participants