Beispiel #1
0
        async private Task <Authorization> Authorize(NetworkCredential credential, Authorization.AuthorizeRequest authRequest)
        {
            var request = CreateRequest("/authorizations");

            request.AddAuthorizationCredential(credential);

            var response = await PostAsJson <Authorization.AuthorizeRequest, Authorization>(request, authRequest);

            Context.Authorize(response.Result);
            return(Context.Authorization);
        }
Beispiel #2
0
        async public Task<Authorization> Authorize(NetworkCredential credential, IEnumerable<Scopes> scopes, string note = null)
        {
            var authRequest = new Authorization.AuthorizeRequest
            {
                Scopes = scopes
            };
            if (note != null)
                authRequest.Note = note;

            return await Authorize(credential, authRequest);
        }
Beispiel #3
0
        async public Task <Authorization> Authorize(NetworkCredential credential, IEnumerable <Scopes> scopes, string note = null)
        {
            var authRequest = new Authorization.AuthorizeRequest
            {
                Scopes = scopes
            };

            if (note != null)
            {
                authRequest.Note = note;
            }

            return(await Authorize(credential, authRequest));
        }