Exemplo n.º 1
0
        public async Task <Response <JObject> > ExplicitUnscopedPassword(string id, string password)
        {
            var auth = new ExplicitAuth
            {
                Identity = new AuthIdentity
                {
                    Methods = new List <string> {
                        AuthMethod.Password
                    },
                    Password = new AuthPassword
                    {
                        User = new AuthUser
                        {
                            Id       = id,
                            Password = password
                        }
                    }
                }
            };

            var form = new { auth };
            var body = Serialize(form);

            var request = new Request
            {
                Uri    = "/v3/auth/tokens",
                Method = HttpMethod.Post,
                Body   = body
            };

            return(await ExecuteAsync <JObject>(request));
        }
Exemplo n.º 2
0
        public async Task <Response <JObject> > ExplicitUnscopedToken(string token)
        {
            var auth = new ExplicitAuth
            {
                Identity = new AuthIdentity
                {
                    Methods = new List <string> {
                        AuthMethod.Token
                    },
                    Token = new AuthToken
                    {
                        Id = token
                    }
                }
            };

            var form = new { auth };
            var body = Serialize(form);

            var request = new Request
            {
                Uri    = "/v3/auth/tokens",
                Method = HttpMethod.Post,
                Body   = body
            };

            return(await ExecuteAsync <JObject>(request));
        }