I am using below app to connect onelogin through my .Netcore2.2 web app.Onelogin logout from .NetCore 2.2 mvc webapp.
I am using onelogin to authenticate users and logged into the system in dotnetcore2.2. for onelogin i have used OAuth for authentication. user can log in successfully but not able to logout from app as there is no proper documentation provided by onelogin.
what i did is revoke that token successfully then use HttpContext.SignoutAsync() to logout from webapp. but its not working.
Anybody have solution on above problem.
Thanks in advance.
var options = new OAuthOptions
{
AuthorizationEndpoint = "https://demo.onelogin.com/oidc/auth",
UserInformationEndpoint = "https://demo.onelogin.com/oidc/me",
TokenEndpoint = "https://demo.onelogin.com/oidc/token",
CallbackPath = new PathString("/callback"),
ClaimsIssuer = "https://openid-connect.onelogin.com/oidc",
ClientId = "2fljk230-9456-0975-5hgd-02649b659666158745",
ClientSecret = "7856f543awer33948968b0fgh5b82d4c21a1e29fec87365c32341ba72e20g89",
SaveTokens = true,
above is for Onelogin OAuth configuration
var client = new HttpClient();
var formData = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("token", accessToken),
new KeyValuePair<string, string>("token_type_hint", "access_token"),
new KeyValuePair<string, string>("client_id", "2fljk230-9456-0975-5hgd-02649b659666158745"),
new KeyValuePair<string, string>("client_secret", "7856f543awer33948968b0fgh5b82d4c21a1e29fec87365c32341ba72e20g89")
});
var uri = String.Format("https://openid-connect.onelogin.com/oidc/token/revocation");
var res = await client.PostAsync(uri, formData);