angular-auth-oidc-client | npm package for OpenID Connect | Authentication library

 by   damienbod TypeScript Version: 18.0.0 License: MIT

kandi X-RAY | angular-auth-oidc-client Summary

kandi X-RAY | angular-auth-oidc-client Summary

angular-auth-oidc-client is a TypeScript library typically used in Security, Authentication applications. angular-auth-oidc-client has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

npm package for OpenID Connect, OAuth Code Flow with PKCE, Refresh tokens, Implicit Flow
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              angular-auth-oidc-client has a medium active ecosystem.
              It has 994 star(s) with 393 fork(s). There are 35 watchers for this library.
              There were 2 major release(s) in the last 6 months.
              There are 94 open issues and 1107 have been closed. On average issues are closed in 42 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of angular-auth-oidc-client is 18.0.0

            kandi-Quality Quality

              angular-auth-oidc-client has 0 bugs and 0 code smells.

            kandi-Security Security

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

            kandi-License License

              angular-auth-oidc-client 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

              angular-auth-oidc-client releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 1173 lines of code, 0 functions and 711 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 angular-auth-oidc-client
            Get all kandi verified functions for this library.

            angular-auth-oidc-client Key Features

            No Key Features are available at this moment for angular-auth-oidc-client.

            angular-auth-oidc-client Examples and Code Snippets

            No Code Snippets are available at this moment for angular-auth-oidc-client.

            Community Discussions

            QUESTION

            spring-security-oauth2-authorization-server + angular-auth-oidc-client
            Asked 2022-Mar-23 at 13:07

            I am using

            ...

            ANSWER

            Answered 2022-Mar-21 at 15:56

            I'll try to provide an answer to the sequence of questions/challenges you're facing.

            Based on comments and updates to the question, it looks like you have a few incorrect configurations to address. From our first round of comments:

            • It looks like you've configured a confidential client (with a client secret, client authentication method, requireProofKey(true) not set

            Note: Also, make sure you're browsing your application from http://127.0.0.1:4200, not http://localhost:4200.

            From the update you provided in the question:

            • You don't want to comment out config.setAllowCredentials(true); in your cors config as the browser needs to be able to send the JSESSIONID cookie with the silent renew process.
            • Spring Authorization Server doesn't currently support refresh tokens for public clients, so my sample doesn't include that option useRefreshToken: true.
            • Your .authorizeRequests() DSL usage is not correct. You don't want to have multiple invocations of that method, as the 2nd one overwrites the first one. You are also targeting the wrong endpoints in the default filter chain. It should look like the sample:

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

            QUESTION

            Authorization based on roles
            Asked 2021-Nov-22 at 13:56

            Is there a way to easily handle authorization based on roles with the lib angular-auth-oidc-client?

            As soon as a user is on the site, I want to identify them, so I use the auto-login-all-routes guards, and this far everything is ok for me. But I'd like to allow access only if the userData contains a specific role, otherwise redirect to the unauthorized page.

            At first I though I could just create a custom version of auto-login-all-routes.guard.ts but as most of the services used are not exported by the module, it doesn't seem to be a good idea.

            Do you have any suggestions?

            ...

            ANSWER

            Answered 2021-Nov-22 at 13:07

            Use 2 guards.

            First one to authenticate:

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

            QUESTION

            Using IdentityServer4/5 without Angular additional libraries
            Asked 2021-Sep-26 at 11:20
            Background

            I check options to migrate my service authentication system to identityserver4\5. I have two websites:

            ...

            ANSWER

            Answered 2021-Sep-26 at 11:20

            If you run SPA you, your best bet is oidc-client.

            But the tutorials you have read are non-sense that suggest client_id/secret auth. No it is not save to have client secret in an SPA app.

            For that reason you have the Auth Code + PKCE Flow. AuthCode + PKCE (Proof of Key Code Exchange) works like Auth Code flow (client_id + secret + a code to obtain the token), but the secret is generated per request (see here). This solves the issue of having a static secret and prevents replay attacks.

            In the past Hybrid Flow, which would return the token in the redirect request from the Identity Server (after logging in and when being redirected back to your website) but this is the recommended approach anymore as Auth Code + PKCE is the more secure approach.

            You can't use a code flow based in the backend in an SPA, because the backend doesn't know the credentials and asking user to directly type in the credentials instead of redirecting them to the identity server is less secure (and less trustworthy since your app has to actually see the credentials) than interactive flows (that redirect you to the Identity Server login page)

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

            QUESTION

            Can @ngtools/webpack AngularWebpackPlugin link partially compiled ivy libraries?
            Asked 2021-Sep-23 at 22:16

            I've got this somewhat old Angular web application which was updated from Angular 6 to Angular 12, however, Angular CLI is not being used for building it, instead it relies on Webpack 5, its loaders and AngularWebpackPlugin from @ngtools/webpack.

            Recently, I needed to upgrade to a latest version of a library I was using and I got greeted with the following warning after my production build:

            ...

            ANSWER

            Answered 2021-Sep-23 at 22:16

            Is there a certain plugin i need to use to "link" the partially compiled libraries so I avoid this issue?

            Yes! You need to add the Angular Linker to process the problematic plugin. It's currently only available as a Babel plugin: @angular/compiler-cli/linker/babel

            In short, add this to your Webpack config and replace ng-click-outside with your plugin(s):

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

            QUESTION

            Karma not running unit test after Angular 12 upgrade
            Asked 2021-Aug-17 at 12:36

            Following the guide we upgraded angular 11 to 12. Before the upgrade karma is running the unit tests without any issues. However, after the upgrade this is what we end up with. Any idea how to check whats wrong.

            I also compared the source with a refresh angular 12 project (karma works here), but changes did not make any difference.

            ...

            ANSWER

            Answered 2021-Aug-17 at 12:36

            Did you ensure that the versions of karma, karma-chrome-launcher, karma-cli, karma-firefox-launcher, (all other karma packages) and jasmine packages were the same between the fresh Angular 12 version and your project? And then did you run a fresh npm install after making sure the versions are the same?

            After that, try comparing test.ts, angular.json and tsconfig.spec.json between the fresh project and your project to ensure they are the same.

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

            QUESTION

            How to login using openid in VSCode extension?
            Asked 2021-Jul-18 at 10:58

            I need some inputs/suggestions on how to login into VSC extension. I have already done similar stuff for web application in angular using https://www.npmjs.com/package/angular-auth-oidc-client library.

            I am developing VSC extension(typescript language) in which I have to authenticate users before they use it. For that, I have cloudIDP auth URL to which I have to forward the request for users to get logged in first. Once user is logged in, Users should come back to VSC extension and then start using in-built extension commands.

            I am using https://www.npmjs.com/package/openid-client library with code flow. I am able to open login url, getting users loggedin, coming back to vscode extension but without token.

            ...

            ANSWER

            Answered 2021-Jun-25 at 14:06

            I got it working.

            After redirection, I have to handle logic in UriHandler class and then hitting the api for getting token there with the code params as received in after redirection.

            Let me know if you want to understand (or in future), I would love to guide there.

            Regards, Alpesh

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

            QUESTION

            How to mock a property of a service (as opposed to a function/method) using Jest
            Asked 2021-May-02 at 01:49

            I am testing this code which has dependency on OidcSecurityService:

            ...

            ANSWER

            Answered 2021-May-01 at 16:41

            userData$ is not a function, so it shouldn't be jest.fn() This isn't documented because non-function properties don't need special treatment from Jest, unless they are existing getters or setters (can be addressed with jest.spyOn third argument).

            It is:

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

            QUESTION

            What is the point of PostLogoutRedirectUri in Open Id/OAuth2.0 logout?
            Asked 2021-Apr-29 at 18:23

            I've been using Identity Server 4.0 as my OpenId Connect provider. I can setup clients in Identity Server with Redirect Uris and Post Logout Redirect Uris. I've also been using the angular-auth-oidc-client to login/logout via the Identity server.

            When logging in, my client library (angular-auth-oidc-client) does pass in the correct Uri specified in the config when calling the authorize endpoint. When I try to login with an incorrect Redirect Uri, Identity Server checks and validates that the Uri provided by the client is one of the accepted one for that client, and shows an error if it isnt (as expected).

            When it comes to logout, none of it seems to be built in. My client library does not send the PostLogoutRedirectUri when calling the logout endpoint. Identity Server's sample code for logout does not except any URIs to be passed in. It's sample code simply gets the Post Logout Redirect Uri value from the database and creates a link on the logged out page. Not only does the sample code not allow the user to specify the Redirect Uri for logout, but it doesn't do any checks or even do a redirect (granted its only sample code and I can change it). I would expect my client library to pass the Uri along and Identity Server to redirect to the Uri after successful logout as long as its one of the "approved" Uris for the client.

            My question is: What even is the point of PostLogoutRedirectUri? Neither Identity Server nor the OIDC client library I'm using do anything useful with it. There doesn't even seem to be an agreed upon convention for the name of the query string parameters to use to pass this Uri to Identity Server. And yet, both the Identity Server and the angular client library seem to have some support for it. So what's the point of this thing? Is it something that will be added or fleshed out later? Did I miss some documentation describing what its for and how to use it?

            ...

            ANSWER

            Answered 2021-Apr-29 at 18:19

            It's a draft standard and support differs between libraries and vendors, but here is a summary:

            • A client uses the post logout redirect URI to log out in a controlled way, typically redirecting to an application page that gives the user a link to sign in again

            • A client could potentially have more than one post_logout_redirect_uri and decide which to use based on runtime conditions

            • The post_logout_redirect_uri sent is meant to only be honoured if it is accompanied by an id_token_hint - and if it matches a configured value against the OAuth client. I believe OIDC will send the current id token but it is worth checking that this is happening in your browser tools.

            • If a post_logout_redirect_uri is not sent then the Authorization Server may use the default one configured

            See the official IETF docs on how this is meant to work.

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

            QUESTION

            Ionic Android OpenID authentication problem
            Asked 2021-Apr-08 at 10:19

            I have an Ionic Angular app which I'm deploying to an Android device. I am using OpenID + KeyCloak for authentication, on the clientside I am taking care of this by using the angular-auth-oidc-client. The configuration I have set up is:

            ...

            ANSWER

            Answered 2021-Apr-08 at 10:19

            Answer: Since an app's origin is http://localhost, and a local server is not running on the phone, the solution is to change the redirect_url parameter of the auth configuration to the package id of the application. Example: com.package.id://home

            This will redirect you back to the app after finishing the authentication in the OAuth page

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

            QUESTION

            Identity server CORS error while calling API from Angular client
            Asked 2021-Mar-03 at 08:55

            Hi I created an Angular app which is connected to the Identity Server 4 for authentication. I registered the angular client with AllowedCorsOrigins, and Scopes are accessing API. I also have other clients ".net core MVC" which also have the same scope (accessing API).I dont have any issue with MVC client but angular I am getting CORS error.

            Identity Server Client

            ...

            ANSWER

            Answered 2021-Mar-03 at 08:44

            I'm not 100% sure that I fully understood the context, but I suspect, that the .NET Core backend service, which serves the Angular app does not use the proxy configuration to the Angular development server on port 4200.

            Therefore in the Startup.cs of the .NET based Angular backend service in ConfigureServices(IServiceCollection services) following configuration is needed:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install angular-auth-oidc-client

            For the example of the Code Flow. For further examples please check the Samples Section.

            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
            Install
          • npm

            npm i angular-auth-oidc-client

          • CLONE
          • HTTPS

            https://github.com/damienbod/angular-auth-oidc-client.git

          • CLI

            gh repo clone damienbod/angular-auth-oidc-client

          • sshUrl

            git@github.com:damienbod/angular-auth-oidc-client.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