Giter Site home page Giter Site logo

aaronpk / sign-in-with-apple-example Goto Github PK

View Code? Open in Web Editor NEW
155.0 11.0 38.0 20 KB

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

Ruby 4.77% PHP 95.23%

sign-in-with-apple-example's People

Contributors

aaronpk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sign-in-with-apple-example's Issues

How to generate the client_secret using the p8 key ?

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 ?

How to generate the client_secret using the key.txt file

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.

  1. From where should I download the library for 'Jose\Component' for the code in file.
    require('vendor/autoload.php');

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;

Error

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

invalid_request

Hey, I used your code for testing purposes and it worked. Within the last few days I received this:
Screenshot 2019-08-23 at 17 30 17

I had to add 'response_mode' => 'form_post' in the $authorize_url to fix it.

invalid client_id

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.

Error getting an access token

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
)

https://imgur.com/a/R19oRks

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.