Skip to content

Spring Boot and Keycloak  #1

@sean-n-riley

Description

@sean-n-riley

Firstly thank you for all your efforts. I checked out your project from your blog "Securing Spring Boot application with Keycloak"

My Keycloak setup is a little different in that it is on another server. However I have configured everything exactly as you have explained. BTW I am also using Java 14, Spring Boot 2.5.0 and Keycloak 13.0.0

When I run the project unchanged and click on the Customer List link on the index page I get the following error:

javax.servlet.ServletException: Circular view path [customers]: would dispatch back to the current handler URL [/customers] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

So I change the following in the controller:

        @GetMapping(path = "/listCustomers")
	public String getCustomers(Model model){
		model.addAttribute("customers", Arrays.asList("John Smith","Uncle Tom","Fred Flinstone"));
		return "customers";
	}

I also change the index.html:

        <a href="/listCustomers">Customer List</a>

and the application.properties:

        keycloak.security-constraints[0].securityCollections[0].patterns[0]=/listCustomers/*

However now I after I successfully login I get a Whitelabel Error Page when I actually expect to see the list of clustomers. There are no errors or logs that I can see.

What have I missed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions