I am using openIdDict's sample MVC application to implement the authorization code flow. However, I have an angular 6 app that I'm using for the landing page the user uses to authorize the request. I've got all the angular stuff working but when I submit my request to "connect/authorize" it is generating a 302. The 302 is being caught by the browser and the redirect is occurring, but I do not want that. I want the request to come as a 200 and then the angular app can control the redirect from there.
Reasons I want to do this: 1. The system I'm integrating with requires additional query string parameters to be populated in the redirect (state * others). I want my angular app to populate those and NOT connect/authorize. 2. The angular app will give the user additional instructions/information after they allow the authorization but before the redirect occurs.
My questions are this: 1. Is it possible to change the response code being generated by openiddict? 2. Am I way off track here and making this harder than it should be?
Startup.cs config
services.AddOpenIddict()
.AddCore(coreOptions =>
{
coreOptions.UseEntityFrameworkCore().UseDbContext<ApplicationDbContext>();
})
.AddServer(serverOptions =>
{
serverOptions.UseMvc();
serverOptions.EnableAuthorizationEndpoint(oauthOptions.AuthorizePath)
.EnableTokenEndpoint(oauthOptions.TokenPath)
.EnableLogoutEndpoint(oauthOptions.LogoutPath);
serverOptions.AllowAuthorizationCodeFlow()
.AllowPasswordFlow()
.AllowRefreshTokenFlow();
serverOptions.SetAccessTokenLifetime(new TimeSpan(0, oauthOptions.AccessTokenLifetimeMinutes, 0));
serverOptions.SetRefreshTokenLifetime(new TimeSpan(0, oauthOptions.RefreshTokenLifetimeMinutes, 0));
if (!oauthOptions.RequireSSL)
{
serverOptions.DisableHttpsRequirement();
}
});