Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseURL in Get-GraphOauthAuthorizationCode should default to \authorize? #37

Open
hanpq opened this issue Apr 29, 2019 · 1 comment
Open

Comments

@hanpq
Copy link

hanpq commented Apr 29, 2019

I think the default of BaseUrl should default to end with "?" so that it is possible to provide a baseurl with custom added parameters. For instance i want to utilize the optional parameter "prompt=select_account" to force the user to get a prompt asking the user to select an account. At the moment the "?" is added on the line 69;

$Url = "{0}?response_type=code&redirect_uri={1}&client_id={2}" -f @(

So if I would provide the custom parameter in the baseurl it would be:
$BaseURL = ....\authorize?prompt=select_account&
which would result in the following concatinated string:
\authorize?prompt=select_account&?response_type=code&....

If the "?" is appended to the default baseurl and removed from the string-formater it would be possible to override the first parameter.

So if I then provide the same BaseUrl the resulting URL would instead be correct;
$BaseURL = ....\authorize?prompt=select_account&
\authorize?prompt=select_account&response_type=code&....

Thanks!

@markekraus
Copy link
Owner

That would be better handled by adding new parameters. the base URL is traditionally everything before a ? and queries are appended after. So adding something like a -Query dictionary parameter and appending those as a generated part of the query string would be the best way to solve this. We have to control the query string in the function because we have to pass some required fields and values. so we cannot expose a raw query string to the end user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants