The Microsoft account client.
Inheritance: DotNetOpenAuth.AspNet.Clients.OAuth2Client
Ejemplo n.º 1
0
        public override ClaimsIdentity ProcessSignInResponse(string realm, string originalUrl, HttpContextBase httpContext)
        {
            var client = new SalesforceClient(appId, secretKey);

            AuthenticationResult result;
            try
            {
                result = client.VerifyAuthentication(httpContext, this.MultiProtocolIssuer.ReplyUrl);
            }
            catch (WebException wex)
            {
                throw new InvalidOperationException(new StreamReader(wex.Response.GetResponseStream()).ReadToEnd(), wex);
            }

            var claims = new List<Claim>
                {
                    new Claim(System.IdentityModel.Claims.ClaimTypes.NameIdentifier, result.ExtraData["id"])
                };

            foreach (var claim in result.ExtraData)
            {
                claims.Add(new Claim("http://schemas.live.com/" + claim.Key, claim.Value));
            }

            return new ClaimsIdentity(claims, "SalesForce");
        }
Ejemplo n.º 2
0
        public override ClaimsIdentity ProcessSignInResponse(string realm, string originalUrl, HttpContextBase httpContext)
        {
            var client = new SalesforceClient(appId, secretKey);

            AuthenticationResult result;

            try
            {
                result = client.VerifyAuthentication(httpContext, this.MultiProtocolIssuer.ReplyUrl);
            }
            catch (WebException wex)
            {
                throw new InvalidOperationException(new StreamReader(wex.Response.GetResponseStream()).ReadToEnd(), wex);
            }

            var claims = new List <Claim>
            {
                new Claim(System.IdentityModel.Claims.ClaimTypes.NameIdentifier, result.ExtraData["id"])
            };

            foreach (var claim in result.ExtraData)
            {
                claims.Add(new Claim("http://schemas.live.com/" + claim.Key, claim.Value));
            }

            return(new ClaimsIdentity(claims, "SalesForce"));
        }
Ejemplo n.º 3
0
 public override void ProcessSignInRequest(Scope scope, HttpContextBase httpContext)
 {
     var client = new SalesforceClient(appId, secretKey);
     client.RequestAuthentication(httpContext, MultiProtocolIssuer.ReplyUrl);
 }
Ejemplo n.º 4
0
        public override void ProcessSignInRequest(Scope scope, HttpContextBase httpContext)
        {
            var client = new SalesforceClient(appId, secretKey);

            client.RequestAuthentication(httpContext, MultiProtocolIssuer.ReplyUrl);
        }