keycloak-angular | Easy Keycloak setup for Angular applications | Identity Management library

 by   mauriciovigolo TypeScript Version: v14.0.0 License: MIT

kandi X-RAY | keycloak-angular Summary

kandi X-RAY | keycloak-angular Summary

keycloak-angular is a TypeScript library typically used in Security, Identity Management, Angular applications. keycloak-angular has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

This library helps you to use keycloak-js in Angular applications providing the following features:.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              keycloak-angular has a low active ecosystem.
              It has 623 star(s) with 238 fork(s). There are 27 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 56 open issues and 308 have been closed. On average issues are closed in 145 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of keycloak-angular is v14.0.0

            kandi-Quality Quality

              keycloak-angular has 0 bugs and 0 code smells.

            kandi-Security Security

              keycloak-angular has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              keycloak-angular code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              keycloak-angular is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              keycloak-angular releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 48 lines of code, 0 functions and 24 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of keycloak-angular
            Get all kandi verified functions for this library.

            keycloak-angular Key Features

            No Key Features are available at this moment for keycloak-angular.

            keycloak-angular Examples and Code Snippets

            No Code Snippets are available at this moment for keycloak-angular.

            Community Discussions

            QUESTION

            keycloak-angular interceptor not sending authorization header
            Asked 2022-Mar-30 at 10:35

            I'm trying to integrate keycloak-angular in my angular application. The authentication flow works well, however when I make a request to my django api I get a 403. The HTTP_AUTHORIZATION header is missing and I don't understand why. When I hardcoded a header in my http service it worked.

            This is the library:

            https://www.npmjs.com/package/keycloak-angular

            This is my keycloak config

            ...

            ANSWER

            Answered 2022-Mar-30 at 09:08

            Seems you’re missing a configuration line, take a look at https://www.npmjs.com/package/keycloak-angular#httpclient-interceptor. enableBearerInterceptor: true which will add the interceptor for you.

            I don’t know if you even need that line because it’s active by default.

            Another issue could be that (would need some insight into the code , but this is purely on speculation) if the token was not added in module/submodules where HttpClient requests were made then it would not been adding the token in http call.

            Source https://stackoverflow.com/questions/71455341

            QUESTION

            Angular-Keycloak is not adding the bearer token by default to my http requests
            Asked 2022-Mar-07 at 15:29

            I'm trying to implement keycloak-angular but I'm not able to add the bearer token by default to my http requests.

            "keycloak-angular": "9.1.0" "keycloak-js": "16.0.0" "Angular": "13.0.2"

            ...

            ANSWER

            Answered 2022-Mar-07 at 15:29

            You have to use an HttpInterceptor to add custom headers at each api call. Create your interceptor, and add it to AppModule

            Source https://stackoverflow.com/questions/71382837

            QUESTION

            Signout from Grafana Iframe - Keycloak
            Asked 2022-Mar-03 at 16:52

            I have an Angular App with a Keycloak authentication system (keycloak-angular)

            I have a Grafana server which allow authentication with OAuth Keycloak

            I have a Keycloak Server with a realm called master, and two cliendID , one for my angularApp, and one for my grafana server.

            In my angular App, I display some iframes coming from my Grafana Server, and with my actual configuration, my Iframes are directly authenticated with OAuth (there is no login screen).

            I have a logout button in my angular App to process a Keycloak logout, which redirects me to the keycloak login screen.

            My problem is that Iframe sessions are saved when I perform a keycloak logout, and if after that I login with a different user, my grafana iframe will still be authenticated with the previous user.

            If I logout inside the grafana app, or the grafana iframe, or go to http://grafana-server:3000/logout , I will get logged out to Grafana, and the grafana iframe session will switch to the new one (the user which is logged in my angular app).

            I want the grafana iframe to perform a sign out when I logout from my Angular App, so the next user logged in will not have the session of the previous user.

            Grafana OAuth Section :

            ...

            ANSWER

            Answered 2021-Dec-16 at 11:35

            OIDC logout has redirect_uri parameter, where user is redirected after logout, so use it to logout from Grafana as well. Desired flow:

            1. Angular logout redirects browser to OIDC logout https://keycloak-server/auth/realms/{realm-name}/protocol/openid-connect/logout?redirect_uri= (of course grafana logout url is URL parameter so it must be URL encoded)

            2. Keycloak after succesfull OIDC logout redirects browser to ("your" http://grafana-server:3000/logout), because it was instrumented to do that with redirect_uri parameter

            3. Grafana executes logout (Grafana user session in the browser will be destroyed) and browser will be redirected to Grafana login page (that can be of course customizes with signout_redirect_url config)

            Source https://stackoverflow.com/questions/70377539

            QUESTION

            Facing issue while upgrading Angular 9 app to Angular 12
            Asked 2021-Dec-16 at 14:06

            When we are trying to update our Angular 9 application(Single SPA micro frontend) to Angular 12 we are facing bellow issue.

            Error on console when trying to run this app:

            ...

            ANSWER

            Answered 2021-Dec-16 at 14:06

            kindly update the custom-webpack with ^12.1.3

            Source https://stackoverflow.com/questions/70300041

            QUESTION

            Angular and KeyCloack - Redirect to route when role is not authorized to acess
            Asked 2021-Dec-14 at 19:02

            I'm trying to redirect to an unauthorized route when a role tries to access an unauthorized route, I'm using keycloack-angular lib:

            npm install keycloak-angular keycloak-js

            My Guard

            ...

            ANSWER

            Answered 2021-Dec-14 at 19:02

            You haven't used the router instance to redirect to another route when access is not allowed. Call the navigate statement to redirect wherever you return false:

            Source https://stackoverflow.com/questions/70353689

            QUESTION

            Unable to initialize keycloak in angular with Promise with dynamic conf
            Asked 2021-Dec-13 at 17:54

            I would like to call a webservice beforce initializing keycloak frontend component from keycloak-angular library to make keycloakconf dynamic. The backendService.keycloakConfig() webservice returne the correct value but the isInitialized variable is always false.

            I think mixing the Promise and the Observable is messing with the initialization.

            Here is the code :

            ...

            ANSWER

            Answered 2021-Dec-10 at 06:21

            I'm not great with Angular, so there's probably a better way to do exactly what you want, and I'd love to hear it because I'd like to do the same thing.

            What I've settled on is on the un-authed pages (landing/splash page pre-login) is to fetch the configuration data and stick it in session storage:

            Source https://stackoverflow.com/questions/70155200

            QUESTION

            How to fix error TS2416: Property 'canActivate' in type 'KeycloakAuthGuard' is not assignable to the same property in base type 'CanActivate'?
            Asked 2021-Aug-30 at 05:56

            I am very new to the angular project. After I clone the project and try to up the project with ng serve.

            So I am getting an error like.

            ...

            ANSWER

            Answered 2021-Aug-30 at 05:56

            Considering you tagged angular6, I suggest you upgrade to the latest supported angular version by KeyCloack. As mentioned here you can and probably should upgrade to angular 12:

            Source https://stackoverflow.com/questions/68979391

            QUESTION

            Angular 12 integration with Keycloak, build problems
            Asked 2021-Jun-13 at 06:24

            I'm trying to execute the following tutorial to integrate an Angular 12 application with Keycloak: Keycloak Integration with Angular Frontend (I've checked other similar tutorials and the instructions are the same).

            As described in the article, I've inserted the following lines in src\environments\environment.ts:

            ...

            ANSWER

            Answered 2021-Jun-12 at 08:00

            the latest library guide does not contain any "credentials" in the configuration. try removing this piece at all, it shouldn't be there

            Source https://stackoverflow.com/questions/67946768

            QUESTION

            JWT authentication in vertx throwing unauthorized
            Asked 2021-May-04 at 13:57

            In my application, i'm using react with keycloak authentication. And i'm trying to secure my back end vertx APIs using the received token from keycloak. I followed this blog http://paulbakker.io/java/jwt-keycloak-angular2/

            i'm calling like this from react

            ...

            ANSWER

            Answered 2021-May-04 at 13:57

            first of all, JWTAuthOptions will do nothing with what you have set under key "public-key" as it does not have any property that maps to it (even if it was possible in Java to have a - in property names). So either set your values on JWTAuthOptions directly using setters or consult documentation for proper keys.

            Second, if your Keycloak is setup with OIDC, then you can simply use OpenIDConnectAuth class that discovers the necessary parameters from Keycloak automatically. Which is way easier.

            Source https://stackoverflow.com/questions/67330362

            QUESTION

            Keycloak with Angular logins automatically
            Asked 2021-Feb-27 at 07:36

            I have an Angular 9 application. Trying to connect with Keycloak server. My final goal is to have SSO for 3 applications, with auth-guard on each (access only some pages requires authentication).

            Having multiple issues, but let do one at a time.

            Using keycloak-angular with keycloak-js.

            When I do keycloak.login() (with or without redirectUri) most of the time it goes to keycloak/auth page and comes back authenticated - without waiting for user input. I did double-check not to save any user data in browser autofill.

            I will share more data upon request.

            Update:

            I see in the Keycloak console, that even after logging out, the session is still active. using:

            ...

            ANSWER

            Answered 2021-Feb-26 at 21:53

            It looks like you don't have proper logout.

            You have to visit your identity provider (Keycloak in this case) OIDC logout endpoint for correct OIDC logout - just navigate whole browser (background AJAX/axios call doesn't work!) to:

            Source https://stackoverflow.com/questions/66385859

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install keycloak-angular

            Run the following command to install both Keycloak Angular and the official Keycloak client library:. Note that keycloak-js is a peer dependency of Keycloak Angular. This change allows greater flexibility of choosing the right version of the Keycloak client version for your project.
            In order to make sure Keycloak is initialized when your application is bootstrapped you will have to add an APP_INITIALIZER provider to your AppModule. This provider will call the initializeKeycloak factory function shown below which will set up the Keycloak service so that it can be used in your application. Use the code provided below as an example and implement it's functionality in your application. In this process ensure that the configuration you are providing matches that of your client as configured in Keycloak. In the example we have set up Keycloak to use a silent check-sso. With this feature enabled, your browser will not do a full redirect to the Keycloak server and back to your application, instead this action will be performed in a hidden iframe, so your application resources only need to be loaded and parsed once by the browser when the app is initialized and not again after the redirect back from Keycloak to your app. To ensure that Keycloak can communicate through the iframe you will have to serve a static HTML asset from your application at the location provided in silentCheckSsoRedirectUri.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mauriciovigolo/keycloak-angular.git

          • CLI

            gh repo clone mauriciovigolo/keycloak-angular

          • sshUrl

            git@github.com:mauriciovigolo/keycloak-angular.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Identity Management Libraries

            vault

            by hashicorp

            k9s

            by derailed

            keepassxc

            by keepassxreboot

            keycloak

            by keycloak

            uuid

            by uuidjs

            Try Top Libraries by mauriciovigolo

            file-matcher

            by mauriciovigoloTypeScript

            nexus-ilegacy

            by mauriciovigoloJavaScript

            events

            by mauriciovigoloCSS