Ejemplo n.º 1
0
        public string InvalidateToken(InvalidTokenRequest token)
        {
            urlBase = string.Format("{0}{1}", (ServiceLocator.Instance.Get <BaseSeusSettings>() ?? new SeusLabSettings()).BaseSeusURL, accountRootEndpoint);
            fullUrl = string.Format("{0}{1}", urlBase, revokeToken);

            var    repositoryBase = new ClientFormUrlEncodeResponse(httpClientHandler, storage);
            string body           = $"token={token.Token}&token_type_hint={token.TokenTypeHint}";

            return(repositoryBase.ConsumeRestService(body, fullUrl, HttpMethod.Post, ContentTypeEncoded));
        }
Ejemplo n.º 2
0
        public string Autenticate(AutenticateRequest request)
        {
            urlBase = string.Format("{0}{1}", (ServiceLocator.Instance.Get <BaseSeusSettings>() ?? new SeusLabSettings()).BaseSeusURL, accountRootEndpoint);
            fullUrl = string.Format("{0}{1}", urlBase, AutenticateEndPoint);

            string body = $"username={request.Username}&password={request.Password}&tag={request.Tag}&session_id={request.SessionId}";

            var headers = new Dictionary <string, string>
            {
                { "Accept", ContentTypeText }
            };

            var repositoryBase = new ClientFormUrlEncodeResponse(httpClientHandler, storage);

            return(repositoryBase.ConsumeRestService(body, fullUrl, HttpMethod.Post, ContentTypeEncoded, headers));
        }