https://github.com/benscabbia/vuejsoidcclient
A fork of joaojosefilho/vuejsOidcClient but configured to run against a project built with vue-cli 3.4.0
https://github.com/benscabbia/vuejsoidcclient
identityserver4 oidc-client vuejs
Last synced: about 1 month ago
JSON representation
A fork of joaojosefilho/vuejsOidcClient but configured to run against a project built with vue-cli 3.4.0
- Host: GitHub
- URL: https://github.com/benscabbia/vuejsoidcclient
- Owner: benscabbia
- License: mit
- Created: 2019-02-27T20:13:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T16:59:43.000Z (over 3 years ago)
- Last Synced: 2025-02-06T04:43:32.943Z (over 1 year ago)
- Topics: identityserver4, oidc-client, vuejs
- Language: JavaScript
- Homepage:
- Size: 1.72 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OIDC Client
Built the project with Vuejs CLI 3.4.0 and then migrated OIDC components from [fork](https://github.com/joaojosefilho/vuejsOidcClient).
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
npm run serve -- --port 5003
```
### Compiles and minifies for production
```
npm run build
```
### Run your tests
```
npm run test
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
---
## Connection with identity provider
Change the parameters of the variable **mgr** of the script [SecurityService.js][2] to the values of your identity provider.
```bash
var mgr = new Oidc.UserManager({
userStore: new Oidc.WebStorageStateStore(),
authority: 'https://localhost:44321',
client_id: 'vuejsclient',
redirect_uri: window.location.origin + '/static/callback.html',
response_type: 'id_token token',
scope: 'openid profile address roles identityserver4api country subscriptionlevel offline_access',
post_logout_redirect_uri: window.location.origin + '/index.html',
silent_redirect_uri: window.location.origin + '/static/silent-renew.html',
accessTokenExpiringNotificationTime: 10,
automaticSilentRenew: true,
filterProtocolClaims: true,
loadUserInfo: true
})
```
The script [SecurityService.js][2] contains triggers and methods from the [oidc-client][3] library.
## API
The script [ApiService.js][4] is responsible for making requests to an API using the libraries [oidc-client][3] and [axios][5]
The **baseUrl** constant receives the static part of the API Url.
```bash
const baseUrl = 'https://localhost:44390/api/';
```
More information on [fork](https://github.com/joaojosefilho/vuejsOidcClient).