Coder Social home page Coder Social logo

keycloakjs-redirect's Introduction

keycloakjs-redirect

Build

Use case

A Frontend Javascript service that integrates with the Keycloak authentication service, guiding users to a login portal when a 401 Unauthorised response is received from an API.

Install

$ npm i keycloak-redirect

Configuration

Import the package, then use the object exposed to return the function authenticate, passing in all mandatory arguments: a config object, a XMLHttpRequest object, and window.

    
   import keycloakRedirect from 'keycloak-redirect';
   
   var config = {
       backend: "http://yourBackendUrl.com",
       clientId: "yourClientId",
       keycloakUrl: "http://yourKeycloakUrl.com"
   };
   
   keycloakRedirect.authenticate(config, new XMLHttpRequest(), $window);

Run Tests

$ npm test

Compile the code with babel

$ npm run compile

keycloakjs-redirect's People

Contributors

cksanders avatar chrisns avatar

Stargazers

Branden Dane avatar Aamir Yaseen avatar Thomas Skjølberg avatar Kevin Hatfield avatar

Watchers

Marcin Ciszak avatar Rustem Suniev avatar Luke Ashe-Browne avatar Douglas Gardner avatar James Cloos avatar Oliver Sterzel avatar Leigh Eyles avatar Colin Gallagher avatar Samuel.Hughes avatar  avatar Mohammud Yassine Jaffoo avatar Leon de Jager avatar Tim Gent avatar Martin Devlin avatar Iqbal Shaikh avatar Giles Hinchcliff avatar Geoffrey Martin avatar  avatar Vijay Jadhav avatar Syed Rafiq avatar  avatar Ben Eustace avatar  avatar

keycloakjs-redirect's Issues

Make tests

even though its simple, this should have a test of some sort of test to assert that it works

Home Office repo clean up

Good morning,

We are looking to clean up some redundant repositories and this one has been raised for moving to attic.
If this is incorrect please drop me a reply or direct email on [email protected].

Thanks,
Rob

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.