aspnet-connect-rest-sample | NET MVC sample shows how to connect to Microsoft Graph | Azure library

 by   microsoftgraph C# Version: Current License: MIT

kandi X-RAY | aspnet-connect-rest-sample Summary

kandi X-RAY | aspnet-connect-rest-sample Summary

aspnet-connect-rest-sample is a C# library typically used in Cloud, Azure applications. aspnet-connect-rest-sample has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

This sample shows how to connect an ASP.NET 4.6 MVC web app to a Microsoft work or school (Azure Active Directory) or personal (Microsoft) account using the Microsoft Graph API to retrieve a user's profile picture, upload the picture to OneDrive, and send an email that contains the photo as an attachment and the sharing link in its text. It uses REST calls to interact with the Microsoft Graph API. In addition, the sample uses the Microsoft Authentication Library (MSAL) for authentication. The MSAL SDK provides features for working with the Azure AD v2.0 endpoint, which enables developers to write a single code flow that handles authentication for both work or school (Azure Active Directory) and personal (Microsoft) accounts.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              aspnet-connect-rest-sample has a low active ecosystem.
              It has 65 star(s) with 59 fork(s). There are 44 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 20 have been closed. On average issues are closed in 26 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of aspnet-connect-rest-sample is current.

            kandi-Quality Quality

              aspnet-connect-rest-sample has 0 bugs and 0 code smells.

            kandi-Security Security

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

            kandi-License License

              aspnet-connect-rest-sample 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

              aspnet-connect-rest-sample releases are not available. You will need to build from source code and install.
              Installation instructions are available. Examples and code snippets are not available.

            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 aspnet-connect-rest-sample
            Get all kandi verified functions for this library.

            aspnet-connect-rest-sample Key Features

            No Key Features are available at this moment for aspnet-connect-rest-sample.

            aspnet-connect-rest-sample Examples and Code Snippets

            No Code Snippets are available at this moment for aspnet-connect-rest-sample.

            Community Discussions

            QUESTION

            Using Microsoft Graph to fetch emails without any user interaction
            Asked 2018-Nov-02 at 21:25

            All I am trying to do is to fetch emails for a userID which is accessible to other users without having them logging into their Microsoft accounts. I have looked at numerous SO posts (this), code samples (this, this) and looked into the specs of OpenID and other docs (this), but still not able to figure it out.

            I have registered app in azure portal and granted required permissions. Using the sample app I am able to fetch user list, but not the email list. I compared the request headers for both user query and email query. Both look the same. Can someone please tell me what I am doing wrong?

            Code is given below:

            Startup.Auth.cs

            ...

            ANSWER

            Answered 2018-Nov-02 at 21:25

            You're using Client_Credentials to authenticate the app and using the /me path in your REST call. These two do not work together.

            Behind the scenes /me is translated into the currently authenticated user (i.e. /users/user@domain. Since you don't have a user authenticated, it simply isn't possible for the Graph to translate your request into an actionable call.

            You need to explicitly reference the user using either their id or their userPrincipalName:

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

            QUESTION

            How to interact w/Microsoft Graph API using ADAL.NET and v1
            Asked 2018-Aug-09 at 14:28

            I've successfully written an API that can access a downstream API (using v1 ADAL.NET), so, I have some codes for that.. (the clients were based on AutoRest)

            Furthermore, I've successfully gotten a sample Microsoft Graph web app running (but, it's coded for v2 and MSAL)

            Does anyone have an example of an API accessing a downstream API (i.e. Microsoft Graph). While I can successfully get my access token, when I go to make the call I only get a Microsoft.Graph.ServiceException:

            ...

            ANSWER

            Answered 2018-Aug-09 at 14:23

            OK, the key things I've learned about interacting with Microsoft Graph API:

            • Yes, you CAN use the new client api NuGet from here with v1 and v2 app registrations
            • An example of the GraphServiceClient client in use is found at this QuickStart but it goes against v2 using MSAL
            • Borrow code from this sample project to do v1 (ADAL.NET) interactions with traditional app registrations in the portal
            • Where I went wrong: somewhere along the way, I thought the resourceUri I was supposed to use was https://graph.windows.net, but it's really just: https://graph.microsoft.com

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

            QUESTION

            MS Graph - Apply admin scoped permissions to normal users
            Asked 2018-Mar-16 at 16:14

            I am using MS Graph example to deal with groups. I have modified my code from the mentioned link. I am able to all my operations with admin account but not with normal user. I am using permission scopes as User.Read Mail.Send Files.ReadWrite Group.ReadWrite.All. Once run the app with admin account and grant the permissions those permissions are not reflecting to normal user. When normal user signin it is again asking for admin consent. What wrong I am doing?

            ...

            ANSWER

            Answered 2018-Mar-15 at 18:20

            There are two types of "consent" in Azure AD land:

            • User Consent: Asks a User to consent to the app doing x,y,z on their behalf.

            • Admin Consent: Asks an Admin to consent to "Non-Admin" users executing User Consent.

            In other words, "Admin Consent" is not the same as an Admin executing "User Consent". All that does is consent to your application operation on behalf of that Admin, it doesn't affect any other users.

            What you need here is to execute an Admin Consent operation. This uses a slightly different URL then you currently use to sign in to your app. I'd suggest taking a look at these articles that cover how this works (discloser: I am the author):

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install aspnet-connect-rest-sample

            Download or clone the Microsoft Graph Connect Sample for ASP.NET 4.6. Open the sample solution in Visual Studio. In the Web.config file in the root directory, replace the ida:AppId and ida:AppSecret placeholder values with the application ID and password that you copied during app registration. Press F5 to build and run the sample. This will restore NuGet package dependencies and open the app. If you see any errors while installing packages, make sure the local path where you placed the solution is not too long/deep. Moving the solution closer to the root of your drive resolves this issue. Sign in with your personal or work or school account and grant the requested permissions. Choose the Get email address button. When the operation completes, the email address of the signed-in user is displayed on the page. Optionally edit the recipient list and email subject, and then choose the Send email button. When the mail is sent, a Success message is displayed below the button. Next steps: Check out the Microsoft Graph Snippets Sample for ASP.NET 4.6 to see examples of common Microsoft Graph operations.
            Download or clone the Microsoft Graph Connect Sample for ASP.NET 4.6.
            Open the sample solution in Visual Studio.
            In the Web.config file in the root directory, replace the ida:AppId and ida:AppSecret placeholder values with the application ID and password that you copied during app registration.
            Press F5 to build and run the sample. This will restore NuGet package dependencies and open the app. If you see any errors while installing packages, make sure the local path where you placed the solution is not too long/deep. Moving the solution closer to the root of your drive resolves this issue.
            Sign in with your personal or work or school account and grant the requested permissions.
            Choose the Get email address button. When the operation completes, the email address of the signed-in user is displayed on the page.
            Optionally edit the recipient list and email subject, and then choose the Send email button. When the mail is sent, a Success message is displayed below the button.
            Next steps: Check out the Microsoft Graph Snippets Sample for ASP.NET 4.6 to see examples of common Microsoft Graph operations.

            Support

            We'd love to get your feedback about this sample. You can send us your questions and suggestions in the Issues section of this repository. Your feedback is important to us. Connect with us on Stack Overflow. Tag your questions with [MicrosoftGraph].
            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/microsoftgraph/aspnet-connect-rest-sample.git

          • CLI

            gh repo clone microsoftgraph/aspnet-connect-rest-sample

          • sshUrl

            git@github.com:microsoftgraph/aspnet-connect-rest-sample.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

            Explore Related Topics

            Consider Popular Azure Libraries

            Try Top Libraries by microsoftgraph

            microsoft-graph-docs

            by microsoftgraphPowerShell

            powershell-intune-samples

            by microsoftgraphPowerShell

            microsoft-graph-toolkit

            by microsoftgraphTypeScript

            msgraph-sdk-javascript

            by microsoftgraphTypeScript

            msgraph-sdk-dotnet

            by microsoftgraphC#