Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OwinWebApp DevApp to configure the redirect_uri parameter. #2798

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions tests/DevApps/aspnet-mvc/OwinWebApi/OwinWebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@
<Content Include="Views\Shared\Error.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Antlr">
<Version>3.5.0.2</Version>
Expand Down
20 changes: 11 additions & 9 deletions tests/DevApps/aspnet-mvc/OwinWebApp/App_Start/Startup.Auth.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Cookies;
using Owin;
using Microsoft.Identity.Web;
using Microsoft.Identity.Web.TokenCacheProviders.InMemory;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Identity.Client;
using Microsoft.Identity.Abstractions;
using Microsoft.Identity.Web;
using Microsoft.Identity.Web.OWIN;
Copy link
Collaborator

@jennyf19 jennyf19 Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? #Resolved

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In reading the PR description, something doesn't seem right. Will need to look from laptop later

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just sorting using statements alphabetically

using System.Web.Services.Description;
using Microsoft.Identity.Web.TokenCacheProviders.InMemory;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Cookies;
using Owin;

namespace OwinWebApp
{
Expand All @@ -21,7 +19,11 @@ public void ConfigureAuth(IAppBuilder app)

OwinTokenAcquirerFactory factory = TokenAcquirerFactory.GetDefaultInstance<OwinTokenAcquirerFactory>();

app.AddMicrosoftIdentityWebApp(factory);
app.AddMicrosoftIdentityWebApp(factory, updateOptions: (options) =>
{
options.RedirectUri = "https://localhost:44386/";
});
Copy link
Author

@victorm-hernandez victorm-hernandez Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RedirectUri

This is the option which affects the redirect_uri parameter. #Resolved

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is needed, it looked to be an app registration issue. Added https://localhost:44386/ as a redirectURI for this app in the lab. Not sure how it is even working, as this redirectURI was not registered to the app.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this issue with a dSTS application, this is unrelated with the configuration of the application. This shows how to affect a specific parameter called redirect_uri.


factory.Services
.Configure<ConfidentialClientApplicationOptions>(options => { options.RedirectUri = "https://localhost:44386/"; })
.AddMicrosoftGraph()
Expand Down
4 changes: 0 additions & 4 deletions tests/DevApps/aspnet-mvc/OwinWebApp/OwinWebApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@
<Content Include="Views\Shared\_LoginPartial.cshtml" />
<Content Include="Views\Account\SignOutCallback.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Antlr">
<Version>3.5.0.2</Version>
Expand Down
Loading