Skip to content

Commit

Permalink
open-pr-cli (Azure-Samples#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenRichards1 authored Oct 11, 2024
1 parent 37e943b commit fbba4e2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ Each project demonstrates one or more aspects of using the Microsoft identity pl

## Contents

| Sample ID <br/>(Microsoft internal tracking) | Sample directory | Application type | Feature(s) demonstrated | Authentication libraries used |
|:--------------------------------------------:|:----------------------------------------------------|------------------|-------------------------|-------------------------------|
| `DOCS-CODE-030` | [console-cli](./console-cli) | | | |
| `DOCS-CODE-010` | [console-daemon](./console-daemon) | | | |
| `DOCS-CODE-025` | [desktop-winforms](./desktop-winforms/) | | | |
| `DOCS-CODE-027` | [desktop-winui](./desktop-winui/) | | | |
| `DOCS-CODE-026` | [desktop-wpf](./desktop-wpf/) | | | |
| `DOCS-CODE-021` | [spa-blazor-wasm](./spa-blazor-wasm/) | | | |
| `DOCS-CODE-001` | [web-api](./web-api/) | | | |
| `DOCS-CODE-004` | [web-api-azure-function](./web-api-azure-function/) | | | |
| `DOCS-CODE-007` | [web-api-obo-client](./web-api-obo-client/) | | | |
| `DOCS-CODE-013` | [web-api-obo-user](./web-api-obo-user/) | | | |
| `DOCS-CODE-016` | [web-app-aspnet](./web-app-aspnet/) | | | |
| `DOCS-CODE-017` | [web-app-blazor-server](./web-app-blazor-server/) | | | |
| `DOCS-CODE-029` and<br/> `DOCS-CODE-035` | [xplat-maui](./xplat-maui/) | | | |
| Sample directory | Application type | Feature(s) demonstrated | Authentication libraries used |
|:----------------------------------------------------|------------------|-------------------------|-------------------------------|
| [console-cli](./console-cli) | | | |
| [console-daemon](./console-daemon) | | | |
| [desktop-winforms](./desktop-winforms/) | | | |
| [desktop-winui](./desktop-winui/) | | | |
| [desktop-wpf](./desktop-wpf/) | | | |
| [spa-blazor-wasm](./spa-blazor-wasm/) | | | |
| [web-api](./web-api/) | | | |
| [web-api-azure-function](./web-api-azure-function/) | | | |
| [web-api-obo-client](./web-api-obo-client/) | | | |
| [web-api-obo-user](./web-api-obo-user/) | | | |
| [web-app-aspnet](./web-app-aspnet/) | | | |
| [web-app-blazor-server](./web-app-blazor-server/) | | | |
| [xplat-maui](./xplat-maui/) | | | |

## Resources

Expand Down
10 changes: 5 additions & 5 deletions console-cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

var config = new PublicClientApplicationOptions
{
// 'Directory (tenant) ID' of app registration in the Azure portal - this value is a GUID
TenantId = "",
// 'Directory (tenant) ID' of the app registration in the Microsoft Entra Admin Center
TenantId = "Enter the client ID obtained from the Microsoft Entra admin center",

// 'Application (client) ID' of app registration in Azure portal - this value is a GUID
ClientId = ""
// 'Application (client) ID' of the app registration in the Microsoft Entra Admin Center
ClientId = "Enter the tenant ID obtained from the Microsoft Entra admin center"
};

// In order to take advantage of token caching, your MSAL client singleton must
Expand All @@ -35,7 +35,7 @@
}
catch (MsalUiRequiredException)
{
// No usable cached token was found for this scope + account or Azure AD insists in
// No usable cached token was found for this scope + account or Entra ID insists in
// an interactive user flow.
}
}
Expand Down
8 changes: 2 additions & 6 deletions console-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ languages:
- csharp
page_type: sample
name: .NET (C#) console application that makes a request to the Graph API via the Device Code flow
description: This .NET 6 console application uses the device code flow for authentication and then makes a request to Microsoft Graph for the user's profile data.
description: This .NET8 console application uses the device code flow for authentication and then makes a request to Microsoft Graph for the user's profile data.
products:
- azure
- entra-id
Expand All @@ -16,11 +16,7 @@ urlFragment: ms-identity-docs-code-console-cli-csharp
<!-- SAMPLE ID: DOCS-CODE-030 -->
# .NET (C#) | console | user sign-in, protected web API access (Microsoft Graph) | Microsoft identity platform

<!-- Build badges here
![Build passing.](https://img.shields.io/badge/build-passing-brightgreen.svg) ![Code coverage.](https://img.shields.io/badge/coverage-100%25-brightgreen.svg) ![License.](https://img.shields.io/badge/license-MIT-green.svg)
-->

This .NET 6 (C#) console application authenticates a user via the device code flow, and then makes a request to the Graph API as the authenticated user. The response to the request is printed to the console.
This .NET8 (C#) console application authenticates a user via the device code flow, and then makes a request to the Graph API as the authenticated user. The response to the request is printed to the console.

```console
$ dotnet run
Expand Down

0 comments on commit fbba4e2

Please sign in to comment.