https://github.com/curityio/oauth-assistant-example
A vanilla JavaScript SPA that uses the OAuth Assistant
https://github.com/curityio/oauth-assistant-example
code-example oauth-assistant oauth2 openid-connect spa
Last synced: 4 months ago
JSON representation
A vanilla JavaScript SPA that uses the OAuth Assistant
- Host: GitHub
- URL: https://github.com/curityio/oauth-assistant-example
- Owner: curityio
- License: apache-2.0
- Created: 2022-07-04T12:08:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-05T10:37:40.000Z (over 1 year ago)
- Last Synced: 2025-03-25T14:46:02.652Z (11 months ago)
- Topics: code-example, oauth-assistant, oauth2, openid-connect, spa
- Language: JavaScript
- Homepage:
- Size: 783 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Curity OAuth Assistant Example App
This is a trivial example application that shows how to use the [@curity/oauth-assistant](https://www.npmjs.com/package/@curity/oauth-assistant) to perform OAuth flows and OpenID Connect session management. The example is written using vanilla Javascript.
## Run the Application
Point the example to your instance of the Curity Identity Server:
```shell
export OAUTH_ASSISTANT_EXAMPLE_BASE_URL='http://localhost:8443'
export OAUTH_ASSISTANT_EXAMPLE_ISSUER='http://localhost:8443/oauth/v2/oauth-anonymous'
```
Then run the application at `http://localhost:8080` with the following commands:
```shell
npm i
npm start
```
## Run the Curity Identity Server
If you do not have an instance, run one using Docker:
```shell
docker run -it -e PASSWORD=Password1 -p 6749:6749 -p 8443:8443 curity.azurecr.io/curity/idsvr
```
Then log in to the Admin UI at `https://localhost:6749/admin` with credentials `admin / Password1`.\
Then [run the first configuration](https://curity.io/resources/learn/first-config/) and accept all defaults.
To prepare the Curity Identity Server you can save the following XML to a file.\
Then use the Admin UI to upload and merge it using the `Changes / Upload` option.
```xml
authentication-service
auth:authentication-service
html1
default-account-manager
default-credential-manager
token-service
as:oauth-service
oauth-assistant-client
true
http://localhost:8080/assisted.html
http://localhost:8080/
openid
html1
http://localhost:8080/assisted.html
https://localhost:8443
http://localhost:8080
```
## Further Information
See the following resources to learn more about running the example and the OAuth Assistant library:
- [OAuth Assistant Example Tutorial](https://curity.io/resources/learn/oauth-assistant/)
- [Running OAuth flows with the Curity Identity Server and OAuth Assistant](https://curity.io/resources/learn/test-using-oauth-assistant/)
- [OAuth Assistant npm page](https://www.npmjs.com/package/@curity/oauth-assistant)