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

[FEATURE REQ] Make it easier to debug aad-starter #21033

Closed
chenrujun opened this issue Apr 29, 2021 · 4 comments · Fixed by #22289
Closed

[FEATURE REQ] Make it easier to debug aad-starter #21033

chenrujun opened this issue Apr 29, 2021 · 4 comments · Fixed by #22289
Assignees
Labels
azure-spring All azure-spring related issues azure-spring-aad Spring active directory related issues. Client This issue points to a problem in the data-plane of the library.
Milestone

Comments

@chenrujun
Copy link

The following content is copied from email:

Do you know if there is any diagnostics capability in Spring Boot Azure AD or tracing I can turn on?

Before I got to a working solution I ran into some problem with getting this to work correctly

In the below controller I did not know the highlighted “SCOPE” part was required and I kept getting 
403 error with the following Authority: @PreAuthorize("hasAuthority('hello')")

It started working after I had the “SCOPE” in as followed

@RestController
public class HomeController {

    @GetMapping("webapiB")
    @ResponseBody
    @PreAuthorize("hasAuthority('SCOPE_hello')")
    public String webapiB() {
        return "Response from WebApiB.";
    }
}

It is quite challenging to debug web API issue returning 401 or 403 error.  
Is there any debugging or diagnostics I can turn on to get more info on why the error occurs?

My current plan:

  1. Add more debug log about Authorities.
  2. Update README.md about how to use these log to debug.
@chenrujun chenrujun added Client This issue points to a problem in the data-plane of the library. azure-spring All azure-spring related issues azure-spring-aad Spring active directory related issues. labels Apr 29, 2021
@chenrujun chenrujun added this to the [2021] July milestone Apr 29, 2021
@chenrujun chenrujun self-assigned this Apr 29, 2021
@stliu
Copy link
Member

stliu commented Apr 30, 2021

@chenrujun where is this "SCOPE" coming from? is it required?

@chenrujun
Copy link
Author

@stliu Yes, it's required. You can get the email by searching Spring Boot Starter Active Directory - Diagnostics capability.

@stliu
Copy link
Member

stliu commented May 7, 2021

@chenrujun my question (as the email sender ) was why it is required, is there any doc about it?

@chenrujun
Copy link
Author

@stliu

No docs. All information is come from that email.

The following content is copied from email:

It is quite challenging to debug web API issue returning 401 or 403 error.  
Is there any debugging or diagnostics I can turn on to get more info on why the error occurs?

So I created this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
azure-spring All azure-spring related issues azure-spring-aad Spring active directory related issues. Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants