question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it posible to add additional QueryParameters when using Authentication.Challenge [Question]

See original GitHub issue

When using MSAL.js I am able to send additional query string parameters to the identity provider using extraQueryParameters when calling loginRedirect. I now need to do this in the context of an ASP.NET MVC application and cannot work out how to add extra query string parameters to the url used when creating the challenge.

If I cannot add the extra param the AzureB2C tenant that I am required to use will not accept the request and fails. Likely the provider here could/should fix this but we’ve been able to make this work for our SPA applications and it’s frustrating me not to find a solution for a webApp

Current code:

var extraParams = new Dictionary<string, string>{{"customParam", "value"}};
var authProps = new AuthenticationProperties(extraParams) { RedirectUri = "/" };
HttpContext.GetOwinContext().Authentication.Challenge(authProps);

It looks like the extraParams are getting encoded up in the state rather than adding extra parameters to the query string

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gavinbarroncommented, Oct 20, 2020

Thanks so much for this, it was exactly what we needed to unblock us 😃

0reactions
jmprieurcommented, Oct 20, 2020

Closing as I believe this is answered. Feel free to reopen if you disagree, @gavinbarron

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add extra query parameter to authorization
Hi, I'm trying to connect to an API using OAuth2, that requires me to include an extra query parameter in the Authorization URL....
Read more >
c# - Owin, pass custom query parameters in Authentication ...
We want to pass custom query parameter in Authentication request using Owin middleware. And we cannot find the way how to implement this...
Read more >
Create Auth challenge Lambda trigger
This Lambda trigger is invoked to create a challenge to present to the user. The request for this Lambda trigger includes the challengeName...
Read more >
What Are Query Strings & Parameters - How to Optimize
A query string is a set of characters tacked onto the end of a URL. The query string begins after the question mark...
Read more >
What is challenge-response authentication?
A static challenge includes the password recovery questions one needs to answer to verify identity. A common example is the password for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found