javascript-oauth2 | Implementation of OAuth2 in JavaScript using CORS | Runtime Evironment library

 by   ox-it JavaScript Version: Current License: No License

kandi X-RAY | javascript-oauth2 Summary

kandi X-RAY | javascript-oauth2 Summary

javascript-oauth2 is a JavaScript library typically used in Server, Runtime Evironment, Nodejs applications. javascript-oauth2 has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Implementation of OAuth2 in JavaScript using CORS
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              javascript-oauth2 has a low active ecosystem.
              It has 58 star(s) with 17 fork(s). There are 16 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 4 open issues and 2 have been closed. On average issues are closed in 138 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of javascript-oauth2 is current.

            kandi-Quality Quality

              javascript-oauth2 has no bugs reported.

            kandi-Security Security

              javascript-oauth2 has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              javascript-oauth2 does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              javascript-oauth2 releases are not available. You will need to build from source code and install.

            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 javascript-oauth2
            Get all kandi verified functions for this library.

            javascript-oauth2 Key Features

            No Key Features are available at this moment for javascript-oauth2.

            javascript-oauth2 Examples and Code Snippets

            No Code Snippets are available at this moment for javascript-oauth2.

            Community Discussions

            QUESTION

            How do I get the logged in users profile for Azure AD OAuth logins?
            Asked 2018-Dec-28 at 10:01

            Following on from JavaScript OAuth2 flow for Azure AD v2 login does not give an access_token, I'm trying to figure out the best endpoint to use, to get the logged in users details (eg, display name, email, etc.).

            However, I noticed in there are 2 potential endpoints I can use

            1. https://outlook.office.com/api/v2.0/me
            2. https://graph.microsoft.com/v1.0/me

            1, is used in bell for hapijs and is documented in Use the Outlook REST API. However, in bell, I can't seem to figure out the scope I need to get it working for OAuth 2.0. I've tried openid, email, profile, Mail.Read (only trying this because I've seen it in some docs), and User.Read, but the first 3 scopes don't give back a access_token as per JavaScript OAuth2 flow for Azure AD v2 login does not give an access_token, and the last 2 (Mail.Read, and User.Read) give me an access_token, but they give me authentication issues when calling https://outlook.office.com/api/v2.0/me with Authorization: 'Bearer [access_token].

            I found the endpoint for 2 at Microsoft Graph: Get user and it seems to work with the User.Read scope. I get the following response using the access_token returned:

            ...

            ANSWER

            Answered 2018-Mar-23 at 17:42

            You should absolutely use Microsoft Graph for this and the /v1.0/me endpoint is the correct URI for retrieving the user's profile information.

            As for finding their email address, there are a few potential properties you could pull:

            • mail: This is the default SMTP address for the user. If it is showing up as null, this suggests the value wasn't populated. Normally this is populated automatically by Exchange but depending on the tenant it may need to be manually populated.

            • proxyAddresses: This is an array of addresses associated with the user. Typically you only use this property when you need to surface a user's alternative email aliases (i.e. name@comp.com & firstname.lastname@comp.com).

            If you are only looking for very basic information (name and email) you be able to use OpenID Connect and skip the Microsoft Graph call entirely. OpenID Connect supports returning the user's profile as part of the profile.

            To use OpenID Connect you need to make a couple of changes to your Authorization request (i.e. the initial call to https://login.microsoftonline.com/common/oauth2/v2.0/authorize):

            1. The response_type must include id_token. (eg. &response_type=id_token+code)
            2. The scope must include openid, profile, and email (eg. &scope=openid profile email user.read).

            When enabled, you will receive an additional property in your Access Token response named id_token. This property holds a JSON Web Token (JWT) that you can decode an obtain the user's profile information:

            As an illustration, I used the settings above to request a token from my test Azure AD instance. I took that token and decoded it (I used http://jwt.ms/ but JWT decoder would work) to get the OpenID Connect profile:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install javascript-oauth2

            You can download it from GitHub.

            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/ox-it/javascript-oauth2.git

          • CLI

            gh repo clone ox-it/javascript-oauth2

          • sshUrl

            git@github.com:ox-it/javascript-oauth2.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