Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
86 views
in Technique[技术] by (71.8m points)

Web Config Spring boot mapping

I have three URL's, all of them are GET request

  1. xyz.com/organization/{id}
  2. xyz.com/organization/optionalQueryParam1=?&optionalQueryParam2=
  3. xyz.com/organization/{differentId}/locations

I want to add different authentication for all the URL's in spring boot web Security config file. They are all mapped in one controller i.e. organization controller.Could you please suggest what I can do here.

Current code impl :

BASE_URL = "/organization"

.mvcMatchers(
            HttpMethod.GET,
            OrganizationController.BASE_URL,
            OrganizationController.BASE_URL + "/*/locations",
            OrganizationController.BASE_URL + "/**"
).authenticated()

so it authenticates all of them. I don't want authentication for xyz.com/organization/{id} get request.

Could you please help with this, thanks in advance.

question from:https://stackoverflow.com/questions/65940226/web-config-spring-boot-mapping

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...