Skip to content

Handle tailing slashes in configured Authority and Instance #278

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

Merged
merged 4 commits into from
Feb 9, 2020
Merged

Handle tailing slashes in configured Authority and Instance #278

merged 4 commits into from
Feb 9, 2020

Conversation

egeskov
Copy link
Contributor

@egeskov egeskov commented Feb 4, 2020

Purpose

Allow configuration of Instance and Authority with or without tailing slash.
Distinguish valid audiences as specified by Client Id or by Audience Uri - don't prefix prefix audience with api:// if already prefixed.

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[X] Other... Please describe:
Input tolerance.

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
  • Test the code

What to Check

Verify that the following are valid

  • Try configuration strings for Authority and Instance that ends with or without slash.
  • Try configuring the Audience using Client Id or Audience Uri (either prefixed by 'api://' or not).

Other Information

@msftclas
Copy link

msftclas commented Feb 4, 2020

CLA assistant check
All CLA requirements met.

@jmprieur jmprieur requested review from jennyf19 and jmprieur February 9, 2020 04:34
@jmprieur
Copy link
Contributor

jmprieur commented Feb 9, 2020

@jennyf19 : interesting proposal to have Microsoft.Identity.Web more robust

@jmprieur jmprieur added the enhancement New feature or request label Feb 9, 2020
options.Audience, $"api://{options.Audience}"
};
// The valid audience could be given as Client Id or as Uri. If it does not start with 'api://', this variant is added to the list of valid audiences.
var validAudiences = new List<string> { options.Audience };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new List [](start = 37, length = 16)

I think we should do a HashSet<string> here instead of a List<string>

@jennyf19
Copy link
Contributor

jennyf19 commented Feb 9, 2020

would be nice to have test coverage for this, but i think it's related to our larger issue of lack of tests atm. :) LGTM otherwise.


In reply to: 583803922 [](ancestors = 583803922)

Copy link
Contributor

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jmprieur jmprieur merged commit c2249d8 into Azure-Samples:master Feb 9, 2020
@jmprieur
Copy link
Contributor

jmprieur commented Feb 9, 2020

Thanks @egeskov

jmprieur added a commit that referenced this pull request Feb 9, 2020
and reverting the UI package upgrade as 3.1.1 has a bug
jmprieur added a commit that referenced this pull request Feb 10, 2020
* Adding unit tests to #278
and reverting the UI package upgrade as 3.1.1 has a bug

* Undoing what the refactoring tools in VS have changed

* Updating the AzureADxx.UI packages

* Adressing PR comments
@TiagoBrenck
Copy link
Contributor

@jmprieur FYI this had been taken care in the refactor PR.

@jmprieur
Copy link
Contributor

yes. It's in the renamingUi branch, with unit tests, moreover, now.

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

Successfully merging this pull request may close these issues.

5 participants