I want to get the client id from this url
https://localhost:44322/Account/Login?ReturnUrl=%2Fconnect%2Fauthorize%3Fresponse_type%3Dcode%26client_id%3DAngular%26state%3DcU1ENEI5VVVhYU1jVzFhWlIyd0F4WkRoR3pMRGxJYng1dkNBQWJXdkFYfkVu%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A4200%26scope%3Doffline_access%2520openid%2520AccountService%2520IdentityService%2520AdministrationService%2520SaasService%2520ProductService%2520NotificationService%2520FileManagement%26code_challenge%3DBpwCGKKxj8134IpedZFvbQgHGMXkTjugkkVFdwly88I%26code_challenge_method%3DS256%26nonce%3DcU1ENEI5VVVhYU1jVzFhWlIyd0F4WkRoR3pMRGxJYng1dkNBQWJXdkFYfkVu%26culture%3Den%26ui-culture%3Den
how to achieve this?
is there any service help me do that?
4 Answer(s)
-
0
I tried this one, gets null
var request = HttpContext.GetOpenIddictServerRequest(); var clientId = request?.ClientId;
-
0
hi
You can use the
AbpOpenIddictRequestHelper
to getOpenIddictRequest
fromReturnUrl
string returnUrl = request.Query["ReturnUrl"]; var openIddictRequestHelper = httpContext.RequestServices.GetService<AbpOpenIddictRequestHelper>(); var openIddictRequest = await openIddictRequestHelper.GetFromReturnUrlAsync(returnUrl);
-
0
hi
You can use the
AbpOpenIddictRequestHelper
to getOpenIddictRequest
fromReturnUrl
string returnUrl = request.Query["ReturnUrl"]; var openIddictRequestHelper = httpContext.RequestServices.GetService<AbpOpenIddictRequestHelper>(); var openIddictRequest = await openIddictRequestHelper.GetFromReturnUrlAsync(returnUrl);
Hi
How to get the returnUrl because this lines itself returns null
var request = HttpContext.GetOpenIddictServerRequest();
-
0
The
ReturnUrl
exists on the request URLhttps://localhost:44322/Account/Login?ReturnUrl=%2Fconnect%2Fauthorize%3Fresponse_type%3Dcode%26client_id%3DAngular%26state%3DcU1ENEI5VVVhYU1jVzFhWlIyd0F4WkRoR3pMRGxJYng1dkNBQWJXdkFYfkVu%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A4200%26scope%3Doffline_access%2520openid%2520AccountService%2520IdentityService%2520AdministrationService%2520SaasService%2520ProductService%2520NotificationService%2520FileManagement%26code_challenge%3DBpwCGKKxj8134IpedZFvbQgHGMXkTjugkkVFdwly88I%26code_challenge_method%3DS256%26nonce%3DcU1ENEI5VVVhYU1jVzFhWlIyd0F4WkRoR3pMRGxJYng1dkNBQWJXdkFYfkVu%26culture%3Den%26ui-culture%3Den
string returnUrl = request.Query["ReturnUrl"]; var openIddictRequestHelper = httpContext.RequestServices.GetService<AbpOpenIddictRequestHelper>(); var openIddictRequest = await openIddictRequestHelper.GetFromReturnUrlAsync(returnUrl);