FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. akash
    3. Best
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 1
    • Controversial 0
    • Groups 0

    Best posts made by akash

    • [ExternalAuthenticationException]AppleIdToken

      FusionAuth version - 1.31.0
      Platform - docker

      Step 1 : Generate Authorization code
      I have successfully retrieved the authorization code from apple using the following endpoint,

      https://appleid.apple.com/auth/authorize?client_id=<my-client-id>&response_type=code&redirect_uri=<my-redirect-url>
      

      Step 2: Generate Tokens
      I have successfully generated an id token using code generated from Generate Authorization code from step 1 using the following request,

      POST-https://appleid.apple.com/auth/token
      
      Content-Type: application/x-www-form-urlencodedclient_id:<my-client-id>
      
      client_secret:<my-client-secret>
      code:<code from-step-1>
      grant_type:authorization_code
      redirect_uri:<my-redirect-url>
      

      Step 3: Setup Apple Identity provider in FusionAuth

      • I have successfully imported the apple private key into Fusionauth Elliptic private key

      • I have successfully created an identity provider for apple using service id, team id, and imported Elliptic private key.

      Step 4: Complete Apple Login in FusionAuth
      I requested Fusionauth using the following request :

      POST /api/identity-provider/login
      
      Request body
      {
          "applicationId": "<my-application-id>",
          "data": {
              "code": "<code-generated-in-step-1>",
              "id_token": "<id-token-generated-in-step-2>",
              "redirect_uri": "<my-redirect-url>"
          },
        "identityProviderId": "13d2a5db-7ef9-4d62-b909-0df58612e775"
      }
      

      I got the following error response with 401:

      {
          "generalErrors": [
              {
                  "code": "[ExternalAuthenticationException]AppleIdToken",
                  "message": "The id_token returned from Apple is invalid or cannot be verified. Unable to complete this login request."
              }
          ]
      }
      

      Can you please guide me on this issue?

      posted in General Discussion
      A
      akash