Spring Security with SAML2 and Okta. Page not found Error

Hello, I’ve been trying to integrate spring-security and Okta with SAML2 following the guide in the link provided.

After completing all the settings, when I access https://localhost:8443/spring-saml, I get the following error:

Page not found
Okta provides infinite ways to connect your employees and customers to technology.

Not even we could connect you to the page you’re looking for. Check the URL and try again, or try some of the links below to get started.

What could be the reason? How can I resolve this?

< Below is the additional information >

Here is my application.yml:

I have placed the Sign on URL in the entity-id, and the Issuer in singlesignon.url.

  port: 8445
	context-path: /spring-saml
	enabled: true
	key-alias: spring
	key-store: "classpath:saml/keystore.jks"
	key-store-password: secret

			  entity-id: https://dev-29859058.okta.com/app/dev-29859058_baeldungspringsecuritysaml_1/exk99z6kfhUBgiGcA5d7/sso/saml
				- certificate-location: "classpath:saml/okta.cert"
			  singlesignon.url: http://www.okta.com/exk99z6kfhUBgiGcA5d7
			  singlesignon.sign-request: false

In the SecurityConfiguration, I’ve put my Okta login account for the username and password.

public UserDetailsService inMemoryUserDetailsManager() {
    // The builder will ensure the passwords are encoded before saving in memory
    User.UserBuilder users = User.withDefaultPasswordEncoder();
    UserDetails user = users
            .roles("USER", "ADMIN")
    return new InMemoryUserDetailsManager(user);

I also put my Okta login account and email account (which are the same) in the “[email]” part of the IndexController source code.

public String index(Model model,
                    @AuthenticationPrincipal Saml2AuthenticatedPrincipal principal) {
    String emailAddress = principal.getFirstAttribute("[email]");
    model.addAttribute("emailAddress", emailAddress);
    model.addAttribute("userAttributes", principal.getAttributes());
    return "index";

The SSO URL configured looks not OK to me. You need to swap entityId and SSO URL in your params