sign-in-with-apple-button-android | An Android library for Sign In with Apple
kandi X-RAY | sign-in-with-apple-button-android Summary
kandi X-RAY | sign-in-with-apple-button-android Summary
An Android library for Sign In with Apple
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sign-in-with-apple-button-android
sign-in-with-apple-button-android Key Features
sign-in-with-apple-button-android Examples and Code Snippets
Community Discussions
Trending Discussions on sign-in-with-apple-button-android
QUESTION
I'm trying to implement Apple sign in into an Android App using this library. The main flow is described in the documentation: the library returns an authorization code on the Android side. This authorization code has to be sent to my backend which, in turn, sends it to the Apple servers in order to get back an access token.
As described here and here, in order to obtain the access token we need to send to the Apple API a list of parameters, the authorization code and a signed JWT. In particular, JWT needs to be signed with a ES256 algorithm using a private .p8 key which has to be generated and downloaded from the Apple developer portal. Apple doc
Here is my PHP script:
...ANSWER
Answered 2020-Jan-21 at 14:07As indicated here, the problem is actually in the signature generated by openSSL.
Using ES256, the digital signature is the concatenation of two unsigned integers, denoted as R and S, which are the result of the Elliptic Curve (EC) algorithm. The length of R || S is 64.
The openssl_sign function generates a signature which is a DER-encoded ASN.1 structure (with size > 64).
The solution is to convert the DER-encoded signature into a raw concatenation of the R and S values. In this library a function "fromDER" is present which perform such a conversion:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sign-in-with-apple-button-android
An App ID including the Sign In with Apple capability
A Service ID using the App ID as its primary mapped to a domain you control which Apple has verified including at least one Return URL
A client ID, which you entered as the Identifier field of the Service ID.
A redirect URI, which you entered as the Return URL.
Include as a dependency using Gradle:. Snapshot versions are also available.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page