Analyse der Antwortadresse an Microsoft AuthC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Analyse der Antwortadresse an Microsoft Auth

Post by Anonymous »

Bei Verwendung dieses Code

Code: Select all

[HttpGet("microsoftlogin")]
public ActionResult MicrosoftLogin()
{
var props = new AuthenticationProperties
{
RedirectUri = "https://localhost:7018/counter"
};

return Challenge(props, MicrosoftAccountDefaults.AuthenticationScheme);
}
< /code>
Alles funktioniert, außer dass am Ende die MS Auth -Seite sagt, dass ich keine Antwortadresse analysiert habe. < /p>
AADSTS900971: No reply address provided.
< /code>
Die resultierende URL anstelle von /counter < /code> Parsing /Signin-Mircosoft < /code>: < /p>
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=b4175612-d967-4e07-a4fd-e68aa92752af&response_type=code&redirect_uri=https%3A%2F%2Flocalhost%3A7018%2Fsignin-microsoft [...]
Dies ist in meinem Programm enthalten.

Code: Select all

builder.Services.AddAuthentication("Cookies")
.AddCookie(opt =>
{
opt.Cookie.Name = "AuthCookie";
})
.AddMicrosoftAccount(opt =>
{
opt.SignInScheme = "Cookies";
opt.ClientId = Configuration["Microsoft:ClientId"]!;
opt.ClientSecret = Configuration["Microsoft:ClientSecret"]!;
});

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post