aaronpk / sign-in-with-apple-example Goto Github PK
View Code? Open in Web Editor NEWSample code for the Sign in with Apple API
Home Page: https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple
License: Apache License 2.0
Sample code for the Sign in with Apple API
Home Page: https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple
License: Apache License 2.0
sign-in-with-apple-example/index.php
Line 79 in 924c92c
After I got rid of the scope query param from the authorize URL login works as expected
I have all the values which are required, only thing i want as encryption in server level is to generate client_secret value from p8 key value itself.
Ex:-
from JWKFactory::createFromKeyFile($keyfile)
to something like JWKFactory::createFromKey('passing-key-value')
Will this work ?
Hi @aaronpk
I have followed all the steps mentioned here in the article - https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple#generate-the-client-secret
I have uploaded a file - client-secret.php on server with all the required details and key.txt file.
Please let me know following.
use Jose\Component\Core\AlgorithmManager;
use Jose\Component\KeyManagement\JWKFactory;
use Jose\Component\Signature\Algorithm\ES256;
use Jose\Component\Signature\JWSBuilder;
use Jose\Component\Signature\Serializer\CompactSerializer;
Hi Aaron,
I tried to run your sample code, so I followed the instruction as you mentioned, but when I clicked the sign in button I got an error message that is said "Your request could not be completed because of an error. Please try again later". do you have any Idea about this error?
Thank you in advance
How to generate client_secret in PHP?
Thanks.
Hi, I have followed your tutorial step by step and I keep getting invalid client_id in my response.
When I test the client secret in https://jwt.io, I get an invalid signature error. Any idea on what might be causing this ? thanks.
Does it return user's name ?
Great tutorial!
I am trying to implement apple sign in for an app (currently in testflight), which also has a web login component which I am trying to get working.
The apple sign in OAuth flow seems to go OK, but the response I get back from the auth / token is a:
stdClass Object
(
[error] => invalid_client
)
I believe my $client id, $client_secret and $redirect_uri are all correct, as this will cause errors earlier in the Auth flow if they are not set correctly.
Is there anything I might be missing? my php demo can be found at: https://thesnowylist.com.au/appleSignIn.php
Thanks again for a well made tutorial.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.