Skip to content
This repository was archived by the owner on Jan 23, 2020. It is now read-only.

Commit f16649e

Browse files
committed
Single sign out support
1 parent 890253d commit f16649e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ There are two projects in this sample. Each needs to be separately registered i
6161
7. Enter a friendly name for the application, for example "TodoListWebApp", select "Web Application and/or Web API", and click next.
6262
8. For the sign-on URL, enter the base URL for the sample, which is by default `https://localhost:44371/signin-oidc`.
6363
9. For the App ID URI, enter `https://<your_tenant_name>/TodoListWebApp`, replacing `<your_tenant_name>` with the name of your Azure AD tenant. Click OK to complete the registration.
64-
10. While still in the Azure portal, click the Configure tab of your application.
65-
11. Find the Client ID value and copy it aside, you will need this later when configuring your application.
64+
1. While still in the Azure portal, click the **Configure** tab of your application.
65+
2. Locate the **Manage Manifest** button in the bottom drawer. Click it and download your application's manifest as a `.json` file.
66+
3. Open the `.json` file in a text editor and change the `logoutUrl` property to `https://localhost:44320/Account/EndSession`. This is the default single sign out URL for this sample.
67+
4. Back in the Azure portal, click **Manage Manifest** then **Upload Manifest**, and upload your updated `.json` file.
68+
5. Finally, locate the **Client ID** value in the **Configure** tab and copy it to your clipboard. You will need it shortly.
6669
12. Create a new key for the application. Save the configuration so you can view the key value. Save this aside for when you configure the project in Visual Studio.
6770
13. In "Permissions to Other Applications", click "Add Application." Select "Other" in the "Show" dropdown, and click the upper check mark. Locate & click on the TodoListService, and click the bottom check mark to add the application. Select "Access TodoListService" from the "Delegated Permissions" dropdown, and save the configuration.
6871

WebApp-WebAPI-OpenIdConnect-DotNet/Controllers/AccountController.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,11 @@ public async Task LogOff()
3333
await HttpContext.Authentication.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
3434
}
3535
}
36+
37+
public async Task EndSession()
38+
{
39+
// If AAD sends a single sign-out message to the app, end the user's session, but don't redirect to AAD for sign out.
40+
await HttpContext.Authentication.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
41+
}
3642
}
3743
}

0 commit comments

Comments
 (0)