WIP separation Web et API

This commit is contained in:
Paul Schneider 2025-02-12 20:41:14 +00:00
commit 49826eae4a
55 changed files with 68 additions and 95 deletions

View file

@ -12,13 +12,13 @@ using Microsoft.AspNetCore.Mvc;
// But, this redirect URI doesn't need to match the OAuth parameter, it's serialized in the query state,
// to be used once the identification ends.
var properties = new AuthenticationProperties { RedirectUri = returnUrl };
return new ChallengeResult("Yavsc", properties);
return new ChallengeResult("oidc", properties);
}
[HttpGet("~/signout")]
public async Task<IActionResult> SignOut(string returnUrl="/") {
return SignOut("Cookies", "Yavsc");
return SignOut("Cookies", "oidc");
}
}

View file

@ -57,7 +57,7 @@ namespace testOauthClient.Controllers
var client = new HttpClient(new HttpClientHandler(){ AllowAutoRedirect=false });
client.DefaultRequestHeaders.Add("Accept", "application/json");
client.SetBearerToken(accessToken);
var content = await client.GetAsync("https://localhost:5001/api/account/me");
var content = await client.GetAsync("https://localhost:6001/api/account/me");
content.EnsureSuccessStatusCode();
var json = await content.Content.ReadAsStreamAsync();
var obj = JsonSerializer.Deserialize<JsonElement>(json);