GithubHelp home page GithubHelp logo

test's Introduction

.NET MAUI (Multi-platform App UI) app connected to Microsoft Graph

This is a template for MAUI(Multi-platform App UI) app that connects to Microsoft Graph. Test

Minimal Path to Awesome ๐Ÿš€

Follow the instructions to successfully run your MAUI app with Microsoft Graph.

Install Visual Studio 2022 with MAUI development workload if you haven't already: MAUI Workload with Visual Studio

1. Register an Azure Active Directory app

Every app that uses Azure AD for authentication must be registered with Azure AD. You can register app through Azure Portal or by using Azure CLI. Please follow one of the options to register your app:

Option 1: Register an app by using Azure CLI
  • Install Azure CLI if you haven't already.
  • Register your app on Microsoft Azure, by creating a new Azure AD app registration:
    • On macOS/Linux/in Bash
      • Open terminal and change the working directory to the root of this project
      • To make the setup script executable, run chmod +x ./setup.sh
      • To register the app, run ./setup.sh
      • When prompted, sign in with your Microsoft 365 developer sandbox account
    • On Windows/in PowerShell
      • Open PowerShell and change the working directory to the root of this project
      • To register the app, run .\setup.ps1
      • When prompted, sign in with your Microsoft 365 developer sandbox account
Option 2: Register an app through Azure Portal
  • Go to Azure Portal and login with your testing account that has Application developer or administrator permissions.
  • Select Azure Active Directory, and select App Registrations from the left side bar. Then select + New registration.
  • Give any name to your app. For Supported account types, select Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox).
  • Set the Redirect URI drop down to Public client/native (mobile & desktop) and enter https://login.microsoftonline.com/common/oauth2/nativeclient. Then, select Register.

Navigate to Overview tab and make a note of the Application (client) ID. You'll use them in the next steps.

2. Run your MAUI app

  • Clone the Hack Together repository to your local workspace or directly download the source code.
  • Update app and secret (only if in the previous step you registered your app manually)
    • Open the project folder dotnet-maui-app-microsoft-graph and double click to MAUIwithMSGraph.sln file to open your project with Visual Studio.
    • Navigate to your MAUI project, and select GraphService.cs file, replace "CLIENT_ID" with Application (client) ID that you copied from your Azure Active Directory app.
  • Select Local Machine button to run your app on your machine.

In your MAUI app, select Load User Info and log in using an Azure AD user account.

After the login, you'll see your display name mentioned in the app:

UWP App

Reference

test's People

Contributors

susanadev avatar

Watchers

 avatar

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.