-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OAuth for Google quickstart #138
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
back: /docs/quick-starts | ||
--- | ||
|
||
Appwrite allows you to authenticate users using their Google account through the Google OAuth2 provider. OAuth authentication is a great way to reduce friction for your users and increase user conversion by simplifying the signup process. You can learn more about Appwrite's other OAuth2 providers [here](https://appwrite.io/docs/client/account?sdk=web-default#accountCreateOAuth2Session). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appwrite allows you to authenticate users using their Google account through the Google OAuth2 provider. OAuth authentication is a great way to reduce friction for your users and increase user conversion by simplifying the signup process. You can learn more about Appwrite's other OAuth2 providers [here](https://appwrite.io/docs/client/account?sdk=web-default#accountCreateOAuth2Session). | |
Appwrite allows you to authenticate users using their Google account through the Google OAuth2 provider. OAuth authentication is a great way to reduce friction for your users and increase user conversion by simplifying the signup process. You can learn more about Appwrite's other OAuth2 providers [here](https://appwrite.io/docs/references/cloud/client-web/account#createOAuth2Session). |
You can do this by following the [Setting up OAuth 2.0](https://support.google.com/googleapi/answer/6158849) guide from Google. | ||
|
||
1. When prompted to provide an **Application type**, select **web application**, irrespective of your target platform. This is because the communication occurs between Appwrite (a web app) and the OAuth2 provider on behalf of your web or mobile app. | ||
1. When prompted to provide a **Authorized redirect URIs** field, provide the **URI** found in the **Google OAuth2 Settings** modal from your Appwrite console. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. When prompted to provide a **Authorized redirect URIs** field, provide the **URI** found in the **Google OAuth2 Settings** modal from your Appwrite console. | |
1. When prompted to provide **Authorized redirect URIs**, provide the **URI** found in the **Google OAuth2 Settings** modal from your Appwrite console. |
// Go to OAuth provider login page | ||
account.createOAuth2Session("google", "[LINK_ON_SUCCESS]", "[LINK_ON_FAILURE]"); | ||
``` | ||
{% /tabsitem %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add a note about how they might need to configure a custom domain if 3rd party cookies are being blocked.
|
||
{% tabs %} | ||
{% tabsitem #js title="Javascript" %} | ||
When a user calls the [Create OAuth2 Session](https://appwrite.io/docs/client/account#accountCreateOAuth2Session) endpoint in your web app, they will be taken to Google's OAuth page to complete their login. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a user calls the [Create OAuth2 Session](https://appwrite.io/docs/client/account#accountCreateOAuth2Session) endpoint in your web app, they will be taken to Google's OAuth page to complete their login. | |
When a user calls the [Create OAuth2 Session](https://appwrite.io/docs/references/cloud/client-web/account#createOAuth2Session) endpoint in your web app, they will be taken to Google's OAuth page to complete their login. |
{% /tabsitem %} | ||
|
||
{% tabsitem #flutter title="Flutter" %} | ||
You can use OAuth in your Flutter application, but some platforms like Android and Apple requires additional configuration to enable the OAuth callback, so the your users can be redirected back to your app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use OAuth in your Flutter application, but some platforms like Android and Apple requires additional configuration to enable the OAuth callback, so the your users can be redirected back to your app. | |
You can use OAuth in your Flutter application, but some platforms like Android and Apple require additional configuration to enable the OAuth callback, so your users can be redirected back to your app. |
} | ||
``` | ||
|
||
To authenticate a user in your Android application, use the [Create OAuth2 Session](https://appwrite.io/docs/client/account?sdk=apple-default#accountCreateOAuth2Session) endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To authenticate a user in your Android application, use the [Create OAuth2 Session](https://appwrite.io/docs/client/account?sdk=apple-default#accountCreateOAuth2Session) endpoint. | |
To authenticate a user in your iOS application, use the [Create OAuth2 Session](https://appwrite.io/docs/references/cloud/client-apple/account#createOAuth2Session) endpoint. |
</manifest> | ||
``` | ||
|
||
To authenticate a user in your Android application, use the [Create OAuth2 Session](https://appwrite.io/docs/client/account?sdk=android-kotlin#accountCreateOAuth2Session) endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To authenticate a user in your Android application, use the [Create OAuth2 Session](https://appwrite.io/docs/client/account?sdk=android-kotlin#accountCreateOAuth2Session) endpoint. | |
To authenticate a user in your Android application, use the [Create OAuth2 Session](https://appwrite.io/docs/references/cloud/client-android-kotlin/account#createOAuth2Session) endpoint. |
</manifest> | ||
``` | ||
|
||
To authenticate a user in your Android application, use the [Create OAuth2 Session](https://appwrite.io/docs/client/account?sdk=android-java#accountCreateOAuth2Session) endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To authenticate a user in your Android application, use the [Create OAuth2 Session](https://appwrite.io/docs/client/account?sdk=android-java#accountCreateOAuth2Session) endpoint. | |
To authenticate a user in your Android application, use the [Create OAuth2 Session](https://appwrite.io/docs/references/cloud/client-android-java/account#createOAuth2Session) endpoint. |
|
||
OAuth2 sessions expire to protect from security risks. | ||
This means, OAuth2 sessions should be refreshed to keep the user authenticated. | ||
You can do this by calling the [Update OAuth Session](https://appwrite.io/docs/client/account#accountUpdateSession) endpoint when ever your user visits your app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do this by calling the [Update OAuth Session](https://appwrite.io/docs/client/account#accountUpdateSession) endpoint when ever your user visits your app. | |
You can do this by calling the [Update OAuth Session](https://appwrite.io/docs/references/cloud/client-android-java/account#updateSession) endpoint whenever your user visits your app. |
// OAuth Login, for simplest implementation you can leave both success and | ||
// failure link empty so that Appwrite handles everything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// OAuth Login, for simplest implementation you can leave both success and | |
// failure link empty so that Appwrite handles everything. |
What does this PR do?
Add OAuth for Google quickstart, written by @Dksie09
Test Plan
Manual review.
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
Yes