Get Started with Spring Boot, SAML, and Okta

Matt Raible

When you say “authentication token”, it typically means an access token, which is part of OpenID Connect (OIDC), not SAML. See Micah Silverman’s Identity, Claims, & Tokens – An OpenID Connect Primer, Part 1 of 3 for more information about OIDC.

haloui

Hi Matt, i have no clue how to add okta saml if my application runs on backend(spring) - frontend (angular), do you have any suggestions?

This test application runs 100%, thanks for that.

Matt Raible

I wouldn’t recommend using SAML. It’s an outdated technology and OAuth 2.0 + OpenID Connect (OIDC) is much easier to implement. See my Build a CRUD App with Angular 9 and Spring Boot 2.2 to see how to combine Angular and Spring Boot and secure them with OIDC.

haloui

I would like to implement it with Saml-Okta, would you still recommend Okta in my case or is it not supported by Okta? (spring-backend/angular-frontend) I ask because you only implemented this example in spring.

Matt Raible

You can probably do it if you combine your Angular and Spring Boot apps into the same artifact and remove all authentication logic from the Angular client. I don’t know of a SAML library for Angular.

Achyuth Chandrashekar

Current https://dev-175770.okta.com… has a different config. Can you guide us how to take metadata url in current set up

Mukesh Kumar

how can i get the user name and print it in my application ?

Manikandan Thanumalayan

Hi Maat, I just followed the steps mentioned. But Iam receiving the following error.
2020-07-28 13:29:04.065 ERROR 24152 — [nio-8443-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path threw exception

java.lang.IllegalArgumentException: Entity ID criteria must be supplied
at org.opensaml.xml.security.criteria.EntityIDCriteria.setEntityID(EntityIDCriteria.java:66) ~[xmltooling-1.4.1.jar!/:na]

Can you please help me

Java Techie

How can i enable both SAML and Spring Basic Authentication in my single application , for example let’s say i don’t have Okta credential then i want allow user , where they can perform form base authentication , urgent help required please

Matt Raible

Can you please send an email to developers@okta.com and include your Okta request ID (it should be in the response headers). That way, they might be able to give you a more detailed stack trace.

akshay ranga

Hi Matt,
I have followed the approach stated above and have configured SpringBoot. My current Scenario is, I have a front end application built using Angular 7. How do I proceed with this situation? I do not want to use OpenID for various reasons. Please guide me on this. Really Would be helpful

Matt Raible

If you’re able to package your front-end application inside your Spring Boot application, I think that’s the way to go. In my Angular + Docker with a Big Hug from Spring Boot tutorial, I showed how to change an Angular app from being separate to being packaged with Spring Boot. Maybe that’ll help?

Siva Reddy Vippala

Hi Matt, do you have an update on blog post on Spring Boot + SAML i.e. without dsl library? (Is it already available somewhere? cant find it anywhere). Appreciate your help.

Matt Raible

We published a new post today that shows how to use a SAMLAuthenticationProvider. See Spring Security SAML and Database Authentication.

Matt Raible

We published a new post today that shows how to do this. Please see Spring Security SAML and Database Authentication.

Matt Raible

We published a new post recently that shows how to switch between database and SAML authentication.

Matt Raible

Maybe our latest Spring Boot + SAML post will help? https://developer.okta.com/…

Ajay Pant

Hi Matt,

Could you please provide same examples with Spring 3.2. In my organization the project is developed and running on spring 3.2.
I need to add Okta with SAML integration with Spring 3.2.

Could you please help, How to proceed.

Urgent help please.

Waiting for you fruitful reply.

Thanks
Ajay Pant

Matt Raible

Here’s some really old Spring + SAML docs that might work. Personally, I’d recommend using the latest releases of open source libraries so you don’t have security vulnerabilities! https://developer.okta.com/…

kishore kancherla

Hi Matt,

I have tried this but I am getting idp discovery error.

This dev-abc.xyz.com page can’t be foundNo webpage was found for the web address: https://dev-abc.xyz.com/sam…

HTTP ERROR 404

Can you suggest how to over come this.

Note: I am using spring boot, okta, saml.

Thanks,
kk