0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/connectors/connector-github
Gao Sun ab82e83afb
chore: upgrade vitest and happy-dom (#6858)
* chore: upgrade happy-dom and vitest

* chore: upgrade @vitest/coverage-v8
2024-12-08 01:11:15 +08:00
..
src fix(connector): fix GitHub connector GET /emails forbidden error (#5925) 2024-05-29 04:24:04 +00:00
CHANGELOG.md release: version packages (#6197) 2024-08-08 13:00:14 +08:00
logo-dark.svg refactor: add connector packages 2023-04-01 15:53:14 +08:00
logo.svg refactor: add connector packages 2023-04-01 15:53:14 +08:00
package.json chore: upgrade vitest and happy-dom (#6858) 2024-12-08 01:11:15 +08:00
README.md chore(connector): update outdated links in connector readme (#6039) 2024-06-18 17:47:49 +08:00

Github connector

The official Logto connector for GitHub social sign-in.

Table of contents

Get started

The GitHub connector enables end-users to sign in to your application using their own GitHub accounts via GitHub OAuth 2.0 authentication protocol.

Sign in with GitHub account

Go to the GitHub website and sign in with your GitHub account. You may register a new account if you don't have one.

Create and configure OAuth app

Follow the creating an OAuth App guide, and register a new application.

Name your new OAuth application in Application name and fill up Homepage URL of the app. You can leave Application description field blank and customize Authorization callback URL as ${your_logto_origin}/callback/${connector_id}. The connector_id can be found on the top bar of the Logto Admin Console connector details page.

Note: If you encounter the error message "The redirect_uri MUST match the registered callback URL for this application." when logging in, try aligning the Authorization Callback URL of your GitHub OAuth App and your Logto App's redirect URL (of course, including the protocol) to resolve the issue.

We suggest not to check the box before Enable Device Flow, or users who sign in with GitHub on mobile devices must confirm the initial sign-in action in the GitHub app. Many GitHub users do not install the GitHub mobile app on their phones, which could block the sign-in flow. Please ignore our suggestion if you are expecting end-users to confirm their sign-in flow. See details of device flow.

Managing OAuth apps

Go to the OAuth Apps page and you can add, edit or delete existing OAuth apps. You can also find Client ID and generate Client secrets in OAuth app detail pages.

Configure your connector

Fill out the clientId and clientSecret field with Client ID and Client Secret you've got from OAuth app detail pages mentioned in the previous section.

scope is a space-delimited list of scopes. If not provided, scope defaults to be read:user.

Config types

Name Type
clientId string
clientSecret string
scope string

Test GitHub connector

That's it. The GitHub connector should be available now. Don't forget to Enable connector in sign-in experience.

Reference