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.

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

spring:
  security:
	saml2:
	  relyingparty:
		registration:
		  okta:
			identityprovider:
			  entity-id: https://dev-29859058.okta.com/app/dev-29859058_baeldungspringsecuritysaml_1/exk99z6kfhUBgiGcA5d7/sso/saml
			  verification.credentials:
				- 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.

@Bean
public UserDetailsService inMemoryUserDetailsManager() {
    // The builder will ensure the passwords are encoded before saving in memory
    User.UserBuilder users = User.withDefaultPasswordEncoder();
    UserDetails user = users
            .username("[username]")
            .password("[password]")
            .roles("USER", "ADMIN")
            .build();
    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.

@RequestMapping("/")
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