Client side public endpoint to generate a redirect_url for OAuth provider that will direct the user to sign in via Apple. User will first sign in to their Apple account, Apple will then call the MoonKey callback URL set during the setup process for Apple provider. Once MoonKey completes the OAuth flow with Apple, we will redirect back to the login/registration redirect URLs set for your App with an internal token for this session. You can then use this token to verify with our VerifyOAuthToken endpoint to retrieve the authenticated user and optionally the original access_token and refresh_token from Apple.
GET /v1/auth/oauth/apple/begin
/v1/auth/oauth/apple/begin?public_token=pk_live_bGcnsYLoObxCSvUcCNBEWgWkOFIBD6JQhx1bMTakf1R6QWrR&redirect=true&login_redirect_url=http://localhost:8080/register
A successful response returns an object with a redirect_url property. If redirect query parameter is set to true, a response with status code 302 will be returned, which allows the browser to automatically redirect to the returned redirect_url without custom client side redirect logic.
Auth Platform API includes all the Auth related features. All Users, Phone Numbers, Emails, and OTPs are associated with an App as the container.
Endpoints only accept App's Secret API keys other than certain endpoints that are used client side or via SDK that accept the public_token.
Authorization: Bearer {api_key}curl \
-X GET https://api.moonkey.fun/v1/auth/users/user_24wFP9pDa9YiMJLun94iKykoZs2 \
-H "Authorization: Bearer sk_test_pRqweh3wvWmJAAVYv7Z0T5iPLzFM4ql0muoyQcjOxGeN3p1r"Required Public token of the App, public token can be exposed in the frontend and client side SDKs.
Optional Determines if the response should be a 302 auto redirect instead of returning the redirect_url in the json with a 200 status code.
Optional If an existing user is found, this URL will be used for redirect upon the completion of the OAuth flow
Optional If a new user is created, this URL will be used for redirect upon the completion of the OAuth flow
Apple response
1