public override ClaimsIdentity ProcessSignInResponse(string realm, string originalUrl, HttpContextBase httpContext) { var client = new AzureAdOAuthClient(_appId, _secretKey, _graphApiEndpoint, _tokenEndpoint, _authorizationEndpoint, _graphApiVersion); AuthenticationResult result; try { result = client.VerifyAuthentication(httpContext, MultiProtocolIssuer.ReplyUrl); } catch (WebException wex) { throw new InvalidOperationException(new StreamReader(wex.Response.GetResponseStream()).ReadToEnd(), wex); } var claims = new List <Claim> { new Claim(ClaimTypes.NameIdentifier, result.ExtraData["id"]) }; return(new ClaimsIdentity(claims, "AzureAd")); }
public override void ProcessSignInRequest(Scope scope, HttpContextBase httpContext) { var client = new AzureAdOAuthClient(_appId, _secretKey, _graphApiEndpoint, _tokenEndpoint, _authorizationEndpoint, _graphApiVersion); client.RequestAuthentication(httpContext, MultiProtocolIssuer.ReplyUrl); }