-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2a07fb
commit f0b858d
Showing
16 changed files
with
154 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
TOOLPAD_AUTH_SECRET= | ||
|
||
TOOLPAD_GITHUB_CLIENT_ID= | ||
TOOLPAD_GITHUB_CLIENT_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# GitHub Authentication | ||
|
||
<p class="description">An app that shows how to set up GitHub authentication in Toolpad.</p> | ||
|
||
Example showcasing how to set up GitHub authentication in a Toolpad app. [The docs](https://mui.com/toolpad/concepts/authentication/). | ||
|
||
<a target="_blank"> | ||
<img src="https://mui.com/static/toolpad/marketing/auth-github.png" alt="GitHub Authentication" style="aspect-ratio: 131/88;" width="524"> | ||
</a> | ||
|
||
## How to run | ||
|
||
To use this example, you need to set the environment variables shown in [.env.example](.env.example). | ||
To get those values, please: | ||
|
||
- Follow [this section](https://mui.com/toolpad/concepts/authentication/#authentication-secret) on how to create an authentication secret. | ||
- Set up your own GitHub OAuth app by following [these instructions](https://mui.com/toolpad/concepts/authentication/#github). | ||
|
||
Then, use `create-toolpad-app` to bootstrap the example: | ||
|
||
```bash | ||
npx create-toolpad-app@latest --example auth-github | ||
``` | ||
|
||
```bash | ||
yarn create toolpad-app --example auth-github | ||
``` | ||
|
||
```bash | ||
pnpm create toolpad-app --example auth-github | ||
``` | ||
|
||
or: | ||
|
||
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/fork/github/mui/mui-toolpad/tree/master/examples/auth-github) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "auth-github", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "toolpad dev", | ||
"build": "toolpad build", | ||
"start": "toolpad start" | ||
}, | ||
"dependencies": { | ||
"@mui/toolpad": "0.1.49" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: application | ||
spec: | ||
authentication: | ||
providers: | ||
- provider: github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/mui/mui-toolpad/v0.1.49/docs/schemas/v1/definitions.json#properties/Page | ||
|
||
apiVersion: v1 | ||
kind: page | ||
spec: | ||
alias: | ||
- sP_2TKM | ||
title: Protected Page | ||
displayName: Protected Page | ||
content: | ||
- component: Text | ||
name: text | ||
props: | ||
value: Only authenticated users can see me. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
TOOLPAD_AUTH_SECRET= | ||
|
||
TOOLPAD_GOOGLE_CLIENT_ID= | ||
TOOLPAD_GOOGLE_CLIENT_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Google Authentication | ||
|
||
<p class="description">An app that shows how to set up Google authentication in Toolpad.</p> | ||
|
||
Example showcasing how to set up Google authentication in a Toolpad app. [The docs](https://mui.com/toolpad/concepts/authentication/). | ||
|
||
<a target="_blank"> | ||
<img src="https://mui.com/static/toolpad/marketing/auth-google.png" alt="Google Authentication" style="aspect-ratio: 131/88;" width="524"> | ||
</a> | ||
|
||
## How to run | ||
|
||
To use this example, you need to set the environment variables shown in [.env.example](.env.example). | ||
To get those values, please: | ||
|
||
- Follow [this section](https://mui.com/toolpad/concepts/authentication/#authentication-secret) on how to create an authentication secret. | ||
- Set up your own Google OAuth client ID by following [these instructions](https://mui.com/toolpad/concepts/authentication/#google). | ||
|
||
Then, use `create-toolpad-app` to bootstrap the example: | ||
|
||
```bash | ||
npx create-toolpad-app@latest --example auth-google | ||
``` | ||
|
||
```bash | ||
yarn create toolpad-app --example auth-google | ||
``` | ||
|
||
```bash | ||
pnpm create toolpad-app --example auth-google | ||
``` | ||
|
||
or: | ||
|
||
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/fork/github/mui/mui-toolpad/tree/master/examples/auth-google) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "auth-google", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "toolpad dev", | ||
"build": "toolpad build", | ||
"start": "toolpad start" | ||
}, | ||
"dependencies": { | ||
"@mui/toolpad": "0.1.49" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: application | ||
spec: | ||
authentication: | ||
providers: | ||
- provider: google |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/mui/mui-toolpad/v0.1.49/docs/schemas/v1/definitions.json#properties/Page | ||
|
||
apiVersion: v1 | ||
kind: page | ||
spec: | ||
alias: | ||
- sP_2TKM | ||
title: Protected Page | ||
displayName: Protected Page | ||
content: | ||
- component: Text | ||
name: text | ||
props: | ||
value: Only authenticated users can see me. |