> ## Documentation Index
> Fetch the complete documentation index at: https://thenile.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub

> Integrate GitHub Single Sign-On with Nile Auth

**1. Setup GitHub Developer Portal**

1. Create a [GitHub Developer](https://github.com/settings/developers) account.
2. Follow the documentation for [creating an OAuth App](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app) in GitHub.
3. Obtain a **Client ID** and **Client Secret** from [GitHub OAuth](https://github.com/settings/developers). Be sure to set the redirect URL to your application handling the Nile Auth requests.
   > [accordion] Github dashboard example
   >
   > ![Discord SSO](https://mintcdn.com/nile/6B-b9nH3DSiJ_Uwi/images/auth/githubexample.png?fit=max\&auto=format\&n=6B-b9nH3DSiJ_Uwi\&q=85\&s=0f2e3261c76b906e7a0b8e9c0d21fdd9)

**2. Save Client ID and Client Secret in Nile**

Save them to your database at `console.thenile.dev` under GitHub in **Tenants & Users -> Configuration**\\

![GitHub configuration on console.thenile.dev](https://mintcdn.com/nile/ZhObK_CvFMgzM-yj/images/singlesignon/github.png?fit=max\&auto=format\&n=ZhObK_CvFMgzM-yj\&q=85\&s=cd19aa3771c26c6c855b65b54f023914)

**3. Add the `GitHub` button to your login page**

The button will redirect the user to GitHub for authentication. Upon successful authentication, the user will be redirected back to your application.

```jsx theme={null}
import { GitHub } from '@niledatabase/react';

function App() {
  return (
    <div>
      <GitHub callbackUrl="/" />
    </div>
  );
}
```

## Related Topics

* [OAuth Concepts](https://thenile.dev/docs/auth/concepts/oauth.md)
* [User Management](https://thenile.dev/docs/auth/concepts/users.md)
* [Other SSO Providers](https://thenile.dev/docs/auth/singlesignon/google.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.