Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/herrmannplatz/axios-keycloak
🔑 Keycloak client with build in axios functionality
https://github.com/herrmannplatz/axios-keycloak
axios keycloak
Last synced: about 2 months ago
JSON representation
🔑 Keycloak client with build in axios functionality
- Host: GitHub
- URL: https://github.com/herrmannplatz/axios-keycloak
- Owner: herrmannplatz
- License: mit
- Created: 2018-09-12T20:26:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T15:26:05.000Z (about 2 years ago)
- Last Synced: 2024-04-25T21:44:42.275Z (9 months ago)
- Topics: axios, keycloak
- Language: JavaScript
- Homepage:
- Size: 1.4 MB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# axios-keycloak [![npm version](https://badge.fury.io/js/axios-keycloak.svg)](https://badge.fury.io/js/axios-keycloak) [![Build Status](https://travis-ci.org/herrmannplatz/axios-keycloak.svg?branch=master)](https://travis-ci.org/herrmannplatz/axios-keycloak)
> Keycloak client with build in axios functionality, letting you create axios instances for doing authenticated request. The module is dealing with the token refresh for you.
## Usage
```javascript
import AxiosKeycloak from 'axios-keycloak'...
const kc = new AxiosKeycloak()
const axiosInstance = kc.createAxiosInstance()kc.init({ onLoad: 'login-required' })
.then(() => {
// authenticated request using keycloak access token
return axiosInstance.get('/user/12345')
})
.then((response) => {
// ...
}// In case you want do an unauthenticated request
const axios = AxiosKeycloak.axios```