Ejemplo n.º 1
0
        public IActionResult ImplicitV1_Grant([FromQuery] ImplicitV1 input)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            return(StatusCode((int)HttpStatusCode.NotImplemented));
        }
Ejemplo n.º 2
0
        public async ValueTask <UserJwtV1> Implicit_GrantV1(ImplicitV1 model)
        {
            var response = await Endpoints.Implicit_AuthV1(model);

            if (response.IsSuccessStatusCode)
            {
                return(await response.Content.ReadAsAsync <UserJwtV1>().ConfigureAwait(false));
            }

            throw new HttpRequestException(response.RequestMessage.ToString(),
                                           new Exception(response.ToString()));
        }
Ejemplo n.º 3
0
        /*
         * https://oauth.net/2/grant-types/implicit/
         */
        public async ValueTask <HttpResponseMessage> Implicit_AuthV1(ImplicitV1 model)
        {
            string content = "?issuer_id=" + HttpUtility.UrlEncode(model.issuer_id)
                             + "&client_id=" + HttpUtility.UrlEncode(model.client_id)
                             + "&grant_type=" + model.grant_type
                             + "&username="******"&redirect_uri=" + HttpUtility.UrlEncode(model.redirect_uri)
                             + "&response_type=" + model.response_type
                             + "&scope=" + HttpUtility.UrlEncode(model.scope)
                             + "&state=" + HttpUtility.UrlEncode(model.state);

            return(await _http.GetAsync("oauth2/v1/ig" + content));
        }