#idcon vol.27 - Sign in with Apple 特集
※ ヤフースコアのことは禁句な!!
https://idcon.org
Sign in with Apple
~ diff from OIDC / OAuth 2.0 & characteristic identifiers design ~
@nov
https://matake.jp
https://rubygems.org/gems/apple_id
https://signin-with-apple.herokuapp.com
Diff from OIDC / OAuth 2.0
OIDC Spec Violations
❖ when nonce is provided in the code or code id_token grant types, it won’t be
included in the id_token returned #FIXED
❖ the code id_token response type does not include c_hash in the returned
id_token #FIXED
❖ the code id_token response type returns the response parameters as query
parameters, not in the fragment
❖ providing a prompt parameter with any value (e.g. login or consent) or empty
results in a 400 with no body #FIXED
❖ when max_age is requested, the id_token does not include an auth_time
claim #FIXED
http://bit.ly/diff-between-siwa-and-oidc
Peculiarities (奇妙な点)
❖ no Discovery document is published at https://appleid.apple.com/.well-known/openid-
configuration which makes developers have to read through the Apple docs to find out
about endpoints, scopes, signing algorithms, authentication methods, etc. #FEELS-OK
❖ no User Info endpoint is provided which means all of the claims about users have to be
included in the (expiring and potentially large) id_token
❖ does not include different claims in the id_token based on scope #PARTIALLY-FIXED
❖ the token endpoint does not accept client_secret_basic as authentication method
(required for OpenID Connect certification) and actually the default method to use for
Clients when there’s no Discovery document that says otherwise
http://bit.ly/diff-between-siwa-and-oidc
Peculiarities (奇妙な点)
❖ authentication towards the token endpoint requires a (custom) JWT assertion as a
client_secret in a client_secret_post authentication method whereas the more
appropriate private_key_jwt authentication method as defined in RFC7523 could have
been used
❖ using unsupported or wrong parameters (e.g. non-existing response_type, scope,
client_id, or redirect_uri) always results in the same message in the browser that says
“Your request could not be completed because of an error. Please try again later.”
without any explanation about what happened, why this is an error or how to fix it
#FEELS-OK #EXCEPT-FOR-SCOPE
❖ exchanging the authorization code according to https://developer.apple.com/
documentation/signinwithapplerestapi/generate_and_validate_tokens should present
a non-standard grant_type=authorization_token but using the standards-compliant
grant_type=authorization_code actually works whereas the former does not, so the
documentation is incorrect #FIXED
http://bit.ly/diff-between-siwa-and-oidc
Peculiarities (奇妙な点)
❖ the Authorization Code grant type (for public Clients?) does not use PKCE to avoid
code injection and code replay attacks #FEELS-OK
❖ when using the sample app available at https://github.com/aaronpk/sign-in-with-
apple-example, adding openid as a scope leads to an error message and it works just
with name and email as scope values; this behavior seems to be inconsistent across
Clients: for some it works, or at least does not lead to errors, for others it does not
work and ends with an error #FIXED?
❖ The scope value of only the very first request by an application is respected. If an
application initially requests only the name scope, and the user allows it, it is then
impossible to later also request the email scope.
http://bit.ly/diff-between-siwa-and-oidc
Characteristic Identifiers Design
Team X
Team X
App A
Team X
Primary App A
Service A-1
Team X
Primary App A
App A-3
App A-2
App A-1
Service A-1
Service A-2
Team X
Primary App A
App A-3
App A-2
App A-1
Service A-1
Service A-2
Primary App B
App B-2
App B-1
Service B-1
User-related Identifiers Design
User ID (sub)
Team X
Primary App A
App A-3
App A-2
App A-1
Service A-1
Service A-2
Primary App B
App B-2
App B-1
Service B-1
Private Email
Team X
Primary App A
App A-3
App A-2
App A-1
Service A-1
Service A-2
Primary App B
App B-2
App B-1
Service B-1
Sign in with Apple
Sign in with Apple
User ID :
Apple User ID :
Public Emails :
Private Email :
12345
000123.abc2xyz.0012
foo@icloud.com
foo@me.com
for-team-x@privaterelay.appleid.com
Q1. Which address to use in each app’s context?
Q2. How to handle email changes after revocation?
Consent Screen
Team X
Primary App A
App A-3
App A-2
App A-1
Service A-1
Service A-2
Primary App B
App B-2
App B-1
Service B-1
Revocation Screen
Team X
Primary App A
App A-3
App A-2
App A-1
Service A-1
Service A-2
Primary App B
App B-2
App B-1
Service B-1
Sign in with Apple
Sign in with Apple
Careful branding strategy required for primary app grouping
Developer-related Identifiers Design
Client ID
Team X
Primary App A
App A-3
App A-2
App A-1
Service A-1
Service A-2
Primary App B
App B-2
App B-1
Service B-1
Private Key
Team X
Primary App A
App A-3
App A-2
App A-1
Service A-1
Service A-2
Primary App B
App B-2
App B-1
Service B-1
CLIENT_ID is of the app / service which originally received the
authorization code, not of the backend server which accesses the token
endpoint, even when refreshing tokens.
Private Email Relay Service
Team X
Primary App A
App A-3
App A-2
App A-1
Service A-1
Service A-2
Primary App B
App B-2
App B-1
Service B-1
MAX 10
MAX 10
For the 11th domain / address, setup new team !?!?
Primary App A sends emails from
App A-1 sends emails from
App A-2 sends emails from
Service A-1 sends emails from
no-reply@primary-app-a.example.com
no-reply@app-a1.example.com
no-reply@app-a2.example.com
no-reply@service-a1.example.com
:
【結論】
iOS, iPad OS, Safari での UX は最高だが
クセが強いので注意

More Related Content

PDF
OAuth 2.0 Updates #technight
PDF
OpenID Connect 101 @ OpenID TechNight vol.11
PDF
ID連携入門 (実習編) - Security Camp 2016
PDF
W3C Web Authentication - #idcon vol.24
PDF
OAuth 2.0 & OpenID Connect @ OpenSource Conference 2011 Tokyo #osc11tk
PDF
OpenID Connect Explained
PPTX
Mit 2014 introduction to open id connect and o-auth 2
PPTX
OpenID Connect 1.0 Explained
OAuth 2.0 Updates #technight
OpenID Connect 101 @ OpenID TechNight vol.11
ID連携入門 (実習編) - Security Camp 2016
W3C Web Authentication - #idcon vol.24
OAuth 2.0 & OpenID Connect @ OpenSource Conference 2011 Tokyo #osc11tk
OpenID Connect Explained
Mit 2014 introduction to open id connect and o-auth 2
OpenID Connect 1.0 Explained

What's hot (20)

PDF
FIDO2 Specifications Overview
PDF
NIST SP 800-63C #idcon vol.22
PDF
TrustBearer - Virginia Security Summit - Web Authentication Strategies - Apri...
PDF
Getting Started with FIDO2
PDF
Full stack security
PPTX
The Client is not always right! How to secure OAuth authentication from your...
PPTX
Technical Considerations for Deploying FIDO Authentication
PDF
Webauthn Tutorial
PPTX
OpenID Connect: An Overview
PDF
Open id connect claims idcon mini vol1
PPT
Understanding OpenID
PDF
Stateless authentication for microservices - Spring I/O 2015
PDF
Incorporating OAuth: How to integrate OAuth into your mobile app
PPTX
OpenID Connect and Single Sign-On for Beginners
PDF
Syrup pay 인증 모듈 개발 사례
PDF
Security Cas And Open Id
PDF
FIDO 생체인증 기술 개발 사례
PDF
OAuth 2.0 Updates #technight in Osaka
PDF
OpenID Connect via WebIntents
PDF
DevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloak
FIDO2 Specifications Overview
NIST SP 800-63C #idcon vol.22
TrustBearer - Virginia Security Summit - Web Authentication Strategies - Apri...
Getting Started with FIDO2
Full stack security
The Client is not always right! How to secure OAuth authentication from your...
Technical Considerations for Deploying FIDO Authentication
Webauthn Tutorial
OpenID Connect: An Overview
Open id connect claims idcon mini vol1
Understanding OpenID
Stateless authentication for microservices - Spring I/O 2015
Incorporating OAuth: How to integrate OAuth into your mobile app
OpenID Connect and Single Sign-On for Beginners
Syrup pay 인증 모듈 개발 사례
Security Cas And Open Id
FIDO 생체인증 기술 개발 사례
OAuth 2.0 Updates #technight in Osaka
OpenID Connect via WebIntents
DevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloak
Ad

Similar to Sign in with Apple (20)

PPTX
How to build Simple yet powerful API.pptx
PDF
API Security - OWASP top 10 for APIs + tips for pentesters
PPTX
What API Specifications and Tools Help Engineers to Construct a High-Security...
PPTX
iOS Provisioning : Running your app in an iOS device
PPT
Live Identity Services Drilldown - PDC 2008
PDF
24032022 Zero Trust for Developers Pub.pdf
PDF
API Testing and Hacking.pdf
PDF
API Testing and Hacking (1).pdf
PDF
API Testing and Hacking.pdf
PDF
Web PenTest Sample Report
PDF
Checkmarx meetup API Security - API Security in depth - Inon Shkedy
PDF
Building Mobile Friendly APIs in Rails
PDF
OAuth for QuickBooks Online REST Services
PDF
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
PPTX
SAP Inbound IDoc.pptx
PPTX
WEB API Gateway
PPTX
Best Practices for Application Development with Box
PPTX
Owasp web security
PPTX
Developing Apps with Azure AD
ODP
Developing a Public API -- at ILTechTalks 2015
How to build Simple yet powerful API.pptx
API Security - OWASP top 10 for APIs + tips for pentesters
What API Specifications and Tools Help Engineers to Construct a High-Security...
iOS Provisioning : Running your app in an iOS device
Live Identity Services Drilldown - PDC 2008
24032022 Zero Trust for Developers Pub.pdf
API Testing and Hacking.pdf
API Testing and Hacking (1).pdf
API Testing and Hacking.pdf
Web PenTest Sample Report
Checkmarx meetup API Security - API Security in depth - Inon Shkedy
Building Mobile Friendly APIs in Rails
OAuth for QuickBooks Online REST Services
I Love APIs 2015: Advanced Crash Course in Apigee Edge Workshop
SAP Inbound IDoc.pptx
WEB API Gateway
Best Practices for Application Development with Box
Owasp web security
Developing Apps with Azure AD
Developing a Public API -- at ILTechTalks 2015
Ad

More from Nov Matake (20)

PDF
#idcon vol.29 - #fidcon WebAuthn, Next Stage
PDF
FedCM - OpenID TechNight vol.19
PDF
Safari (ITP) & Chrome (SameSite=Lax as default) が Federation に与える影響 - OpenID ...
PDF
FIDO @ LINE - #idcon vol.24
PDF
NIST SP 800-63C - Federation and Assertions (FINAL)
PDF
OPTiM StoreにおけるSCIM & OIDC活用事例 - ID&IT 2016
PDF
NIST SP 800-63-3 #idcon vol.22
PDF
ID連携概要 - OpenID TechNight vol.13
PDF
ミスコンとプライバシー ~ IdentityDuck誕生秘話 ~ #idcon
PDF
SAML / OpenID Connect / OAuth / SCIM 技術解説 - ID&IT 2014 #idit2014
PDF
FIDO alliance #idcon vol.18
PDF
池澤あやかと学ぼう!: はじめてのOAuthとOpenID Connect - JICS 2014
PDF
OAuth認証再考からのOpenID Connect #devlove
PDF
ID & IT 2013 - OpenID Connect Hands-on
PDF
JWT Translation #technight
PDF
MIT-KIT Intro at #idcon sattelite
PDF
Self isssued-idp
PDF
IIW 16th Report at #idcon
PDF
Whats wrong oauth_authn
PDF
OAuth 2.0 #idit2012
#idcon vol.29 - #fidcon WebAuthn, Next Stage
FedCM - OpenID TechNight vol.19
Safari (ITP) & Chrome (SameSite=Lax as default) が Federation に与える影響 - OpenID ...
FIDO @ LINE - #idcon vol.24
NIST SP 800-63C - Federation and Assertions (FINAL)
OPTiM StoreにおけるSCIM & OIDC活用事例 - ID&IT 2016
NIST SP 800-63-3 #idcon vol.22
ID連携概要 - OpenID TechNight vol.13
ミスコンとプライバシー ~ IdentityDuck誕生秘話 ~ #idcon
SAML / OpenID Connect / OAuth / SCIM 技術解説 - ID&IT 2014 #idit2014
FIDO alliance #idcon vol.18
池澤あやかと学ぼう!: はじめてのOAuthとOpenID Connect - JICS 2014
OAuth認証再考からのOpenID Connect #devlove
ID & IT 2013 - OpenID Connect Hands-on
JWT Translation #technight
MIT-KIT Intro at #idcon sattelite
Self isssued-idp
IIW 16th Report at #idcon
Whats wrong oauth_authn
OAuth 2.0 #idit2012

Recently uploaded (20)

PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
Five Habits of High-Impact Board Members
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
Architecture types and enterprise applications.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
Getting started with AI Agents and Multi-Agent Systems
A novel scalable deep ensemble learning framework for big data classification...
Assigned Numbers - 2025 - Bluetooth® Document
A review of recent deep learning applications in wood surface defect identifi...
sustainability-14-14877-v2.pddhzftheheeeee
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Five Habits of High-Impact Board Members
CloudStack 4.21: First Look Webinar slides
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Architecture types and enterprise applications.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
A contest of sentiment analysis: k-nearest neighbor versus neural network
Web Crawler for Trend Tracking Gen Z Insights.pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Getting Started with Data Integration: FME Form 101
NewMind AI Weekly Chronicles – August ’25 Week III
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Taming the Chaos: How to Turn Unstructured Data into Decisions
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Getting started with AI Agents and Multi-Agent Systems

Sign in with Apple

  • 1. #idcon vol.27 - Sign in with Apple 特集 ※ ヤフースコアのことは禁句な!! https://idcon.org
  • 2. Sign in with Apple ~ diff from OIDC / OAuth 2.0 & characteristic identifiers design ~ @nov
  • 6. Diff from OIDC / OAuth 2.0
  • 7. OIDC Spec Violations ❖ when nonce is provided in the code or code id_token grant types, it won’t be included in the id_token returned #FIXED ❖ the code id_token response type does not include c_hash in the returned id_token #FIXED ❖ the code id_token response type returns the response parameters as query parameters, not in the fragment ❖ providing a prompt parameter with any value (e.g. login or consent) or empty results in a 400 with no body #FIXED ❖ when max_age is requested, the id_token does not include an auth_time claim #FIXED http://bit.ly/diff-between-siwa-and-oidc
  • 8. Peculiarities (奇妙な点) ❖ no Discovery document is published at https://appleid.apple.com/.well-known/openid- configuration which makes developers have to read through the Apple docs to find out about endpoints, scopes, signing algorithms, authentication methods, etc. #FEELS-OK ❖ no User Info endpoint is provided which means all of the claims about users have to be included in the (expiring and potentially large) id_token ❖ does not include different claims in the id_token based on scope #PARTIALLY-FIXED ❖ the token endpoint does not accept client_secret_basic as authentication method (required for OpenID Connect certification) and actually the default method to use for Clients when there’s no Discovery document that says otherwise http://bit.ly/diff-between-siwa-and-oidc
  • 9. Peculiarities (奇妙な点) ❖ authentication towards the token endpoint requires a (custom) JWT assertion as a client_secret in a client_secret_post authentication method whereas the more appropriate private_key_jwt authentication method as defined in RFC7523 could have been used ❖ using unsupported or wrong parameters (e.g. non-existing response_type, scope, client_id, or redirect_uri) always results in the same message in the browser that says “Your request could not be completed because of an error. Please try again later.” without any explanation about what happened, why this is an error or how to fix it #FEELS-OK #EXCEPT-FOR-SCOPE ❖ exchanging the authorization code according to https://developer.apple.com/ documentation/signinwithapplerestapi/generate_and_validate_tokens should present a non-standard grant_type=authorization_token but using the standards-compliant grant_type=authorization_code actually works whereas the former does not, so the documentation is incorrect #FIXED http://bit.ly/diff-between-siwa-and-oidc
  • 10. Peculiarities (奇妙な点) ❖ the Authorization Code grant type (for public Clients?) does not use PKCE to avoid code injection and code replay attacks #FEELS-OK ❖ when using the sample app available at https://github.com/aaronpk/sign-in-with- apple-example, adding openid as a scope leads to an error message and it works just with name and email as scope values; this behavior seems to be inconsistent across Clients: for some it works, or at least does not lead to errors, for others it does not work and ends with an error #FIXED? ❖ The scope value of only the very first request by an application is respected. If an application initially requests only the name scope, and the user allows it, it is then impossible to later also request the email scope. http://bit.ly/diff-between-siwa-and-oidc
  • 14. Team X Primary App A Service A-1
  • 15. Team X Primary App A App A-3 App A-2 App A-1 Service A-1 Service A-2
  • 16. Team X Primary App A App A-3 App A-2 App A-1 Service A-1 Service A-2 Primary App B App B-2 App B-1 Service B-1
  • 18. User ID (sub) Team X Primary App A App A-3 App A-2 App A-1 Service A-1 Service A-2 Primary App B App B-2 App B-1 Service B-1
  • 19. Private Email Team X Primary App A App A-3 App A-2 App A-1 Service A-1 Service A-2 Primary App B App B-2 App B-1 Service B-1
  • 22. User ID : Apple User ID : Public Emails : Private Email : 12345 000123.abc2xyz.0012 foo@icloud.com foo@me.com for-team-x@privaterelay.appleid.com Q1. Which address to use in each app’s context? Q2. How to handle email changes after revocation?
  • 23. Consent Screen Team X Primary App A App A-3 App A-2 App A-1 Service A-1 Service A-2 Primary App B App B-2 App B-1 Service B-1
  • 24. Revocation Screen Team X Primary App A App A-3 App A-2 App A-1 Service A-1 Service A-2 Primary App B App B-2 App B-1 Service B-1
  • 27. Careful branding strategy required for primary app grouping
  • 29. Client ID Team X Primary App A App A-3 App A-2 App A-1 Service A-1 Service A-2 Primary App B App B-2 App B-1 Service B-1
  • 30. Private Key Team X Primary App A App A-3 App A-2 App A-1 Service A-1 Service A-2 Primary App B App B-2 App B-1 Service B-1
  • 31. CLIENT_ID is of the app / service which originally received the authorization code, not of the backend server which accesses the token endpoint, even when refreshing tokens.
  • 32. Private Email Relay Service Team X Primary App A App A-3 App A-2 App A-1 Service A-1 Service A-2 Primary App B App B-2 App B-1 Service B-1
  • 34. For the 11th domain / address, setup new team !?!? Primary App A sends emails from App A-1 sends emails from App A-2 sends emails from Service A-1 sends emails from no-reply@primary-app-a.example.com no-reply@app-a1.example.com no-reply@app-a2.example.com no-reply@service-a1.example.com :
  • 35. 【結論】 iOS, iPad OS, Safari での UX は最高だが クセが強いので注意