Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Oauth provider guides #383

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Oauth provider guides #383

wants to merge 9 commits into from

Conversation

gewenyu99
Copy link
Contributor

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

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?

(Write your answer here.)

account.createOAuth2Session('github', '[LINK_ON_SUCCESS]', '[LINK_ON_FAILURE]');
```

### Flutter
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

});
```

### Flutter
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't close this modal, we'll need to create a GitHub OAuth app to complete this form.

## Creating a GitHub OAuth app
To use GitHub OAuth with Appwrite, you need to create an OAuth app on your GitHub account or in your Github organization. You can do this by following the [Creating an OAuth App](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) guide from GitHub. When prompted to provide a **Authorization callback URL**, provide the **URI** found in the **Github OAuth2 Settings** modal from your Appwrite console.
Copy link
Contributor

@stnguyen90 stnguyen90 Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To use GitHub OAuth with Appwrite, you need to create an OAuth app on your GitHub account or in your Github organization. You can do this by following the [Creating an OAuth App](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) guide from GitHub. When prompted to provide a **Authorization callback URL**, provide the **URI** found in the **Github OAuth2 Settings** modal from your Appwrite console.
To use GitHub OAuth with Appwrite, you need to create an OAuth app on your GitHub account or in your GitHub organization. You can do this by following the [Creating an OAuth App](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) guide from GitHub. When prompted to provide an **Authorization callback URL**, provide the **URI** found in the **Github OAuth2 Settings** modal from your Appwrite console.

1. Navigate to your Appwrite project
2. Navigate to **Auth** > **Settings**
3. Find and open the OAuth provider
4. In the **Github OAuth2 Settings** modal, use the toggle to enable the provider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. In the **Github OAuth2 Settings** modal, use the toggle to enable the provider
4. In the **GitHub OAuth2 Settings** modal, use the toggle to enable the provider

This is going to be fixed in 1.4.x:

image

## Creating a GitHub OAuth app
To use GitHub OAuth with Appwrite, you need to create an OAuth app on your GitHub account or in your Github organization. You can do this by following the [Creating an OAuth App](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) guide from GitHub. When prompted to provide a **Authorization callback URL**, provide the **URI** found in the **Github OAuth2 Settings** modal from your Appwrite console.

After you've created your GitHub OAuth app, you can head back to your Appwrite console to complete the form in the **Github OAuth2 Settings** modal.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After you've created your GitHub OAuth app, you can head back to your Appwrite console to complete the form in the **Github OAuth2 Settings** modal.
After you've created your GitHub OAuth app, you can head back to your Appwrite console to complete the form in the **GitHub OAuth2 Settings** modal.

To use GitHub OAuth with Appwrite, you need to create an OAuth app on your GitHub account or in your Github organization. You can do this by following the [Creating an OAuth App](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) guide from GitHub. When prompted to provide a **Authorization callback URL**, provide the **URI** found in the **Github OAuth2 Settings** modal from your Appwrite console.

After you've created your GitHub OAuth app, you can head back to your Appwrite console to complete the form in the **Github OAuth2 Settings** modal.
- Find the **Client ID** in your GitHub OAuth app and provide this in the **App ID** field in the **Github OAuth2 Settings** modal from the Appwrite console.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Find the **Client ID** in your GitHub OAuth app and provide this in the **App ID** field in the **Github OAuth2 Settings** modal from the Appwrite console.
- Find the **Client ID** in your GitHub OAuth app and provide this in the **App ID** field in the **GitHub OAuth2 Settings** modal from the Appwrite console.


After you've created your GitHub OAuth app, you can head back to your Appwrite console to complete the form in the **Github OAuth2 Settings** modal.
- Find the **Client ID** in your GitHub OAuth app and provide this in the **App ID** field in the **Github OAuth2 Settings** modal from the Appwrite console.
- Navigate to the **Client secrets** section in your Github OAuth app and click **Generate a new client secret**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Navigate to the **Client secrets** section in your Github OAuth app and click **Generate a new client secret**.
- Navigate to the **Client secrets** section in your GitHub OAuth app and click **Generate a new client secret**.

After you've created your GitHub OAuth app, you can head back to your Appwrite console to complete the form in the **Github OAuth2 Settings** modal.
- Find the **Client ID** in your GitHub OAuth app and provide this in the **App ID** field in the **Github OAuth2 Settings** modal from the Appwrite console.
- Navigate to the **Client secrets** section in your Github OAuth app and click **Generate a new client secret**.
- Copy your new client secret and provide this in the **App Secret** field in the **Github OAuth2 Settings** modal from the Appwrite console.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Copy your new client secret and provide this in the **App Secret** field in the **Github OAuth2 Settings** modal from the Appwrite console.
- Copy your new client secret and provide this in the **App Secret** field in the **GitHub OAuth2 Settings** modal from the Appwrite console.

Before you can use GitHub to authenticate users, you need to enable the provider in your Appwrite console.
1. Navigate to your Appwrite project
2. Navigate to **Auth** > **Settings**
3. Find and open the OAuth provider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Find and open the OAuth provider
3. Find and open the OAuth2 provider

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants