Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Conversation

@derisen
Copy link
Contributor

@derisen derisen commented Aug 29, 2022

Purpose

  • This updates Angular App Roles sample to follow basher and zero trust guidelines

Does this introduce a breaking change?

[ x ] Yes [ ] No 

Pull Request Type

What kind of change does this Pull Request introduce?

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

How to Test

  • Get the code
git clone https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial.git cd ms-identity-javascript-angular-tutorial git checkout basher-5-1 cd 5-AccessControl/1-call-api-roles/SPA npm install cd ../API/TodoListAPI dotnet restore 
  • Test the code
    • Run the sample end-to-end
    • Assign one user to admin role, and test access
    • Assign one user to user role, and test access
@derisen derisen changed the title Basher 5 1 Update 5.1 to follow basher and zero trust guidelines Aug 29, 2022
1. Ensure that the **My APIs** tab is selected.
1. In the list of APIs, select the API `msal-angular-app`.
* Since this app signs-in users, we will now proceed to select **delegated permissions**, which is is requested by apps when signing-in users.
1. In the **Delegated permissions** section, select the **access_as_user** in the list. Use the search box if necessary.
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. In the Delegated permissions section, select the access_as_user in the list. Use the search box if necessary.

codegen is generating "1. In the Delegated permissions section, select the Access 'msal-angular-app' in the list. Use the search box if necessary."

could you look this in code gen for me please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kalyankrishna1
Copy link
Contributor

npm start

npm restore


Refers to: 5-AccessControl/1-call-api-roles/README.md:232 in 88b0b70. [](commit_id = 88b0b70, deletion_comment = False)

Copy link
Contributor

@salman90 salman90 left a comment

Choose a reason for hiding this comment

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

looks good @derisen

Copy link
Contributor

@v-michaelmi v-michaelmi left a comment

Choose a reason for hiding this comment

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

Aside from a few nits LGTM

}

removeTodo(id: string): void {
this.service.deleteTodo(+id).subscribe(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the id parameter of deleteTodo have to be a number here?

ngOnInit(): void {
this.route.paramMap.subscribe((params) => {
let id = +params.get('id')!;
this.service.getTodo(+id).subscribe((response: Todo) => {
Copy link
Contributor

@v-michaelmi v-michaelmi Aug 31, 2022

Choose a reason for hiding this comment

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

Same here with id being a number.

Type mismatching like this seems like it might be a possible logic land mine in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

id prop is of type int/number in both frontend and backend, so I think we are safe here. The query param is in string so I had to cast it.

Copy link
Contributor

@kalyankrishna1 kalyankrishna1 left a comment

Choose a reason for hiding this comment

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

:shipit:

@derisen derisen merged commit 95d7c6a into main Sep 7, 2022
@derisen derisen deleted the basher-5-1 branch September 22, 2022 02:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

5 participants