 Hi everyone, I'm Brian DeMers and today I'm going to show you how to build a secure Spring Boot application with Octa in less than five minutes. Let's get started. One of the most common ways to create a new Spring Boot project is to go to start.spring.io. You can select from a variety of options, your project type, Maven or Gradle, your language, Java, Kotlin or Groovy. You can also select your dependencies. So today we're going to build a simple web application. So we'll select web for Spring web and I'll type Octa and select Octa and then we could hit this green generate button. However, we're going to go to the command line and I'm going to show you how this is even easier. Many people don't know that you can actually query the start.spring.io API right from the command line. So I'm going to use HDB Pi and go to start.spring.io and I'll get a simple description here and you can pipe this through less if you want to read it all. So these are the parameters, the descriptions, their values. You can also use curl and do the same thing, of course, and it'll give you contact sensitive help, which will show how to do these commands with curl. I'm going to go back here, start.spring.io and I'm going to go starter.tgz and then I'm going to have dependencies. I can spell it correctly equals web comma octa and then I'm going to give this a base directory name of let's say example, example demo. And of course I need to pipe this to tar. So tar, extract zip verbose file and then we'll use the input string here to enter and this will create my new directory. So now we can just jump in here, example demo. So this project doesn't really have a lot going on. You can see it's one class here. It doesn't really do anything. So now we have an application. We need two more things. We need some rest endpoints or some sort of endpoint to make it a web app and we need to make it secure. So we need some sort of IDP. And I'm going to use octa. Octa is going to handle all of the OAuth complexities for you and you can register, create an account, set up your local application all with one command. We have a Maven plugin that you can use. So if you just type MVN com to octa, octa Maven plugin set up. This will take care of everything for you. Oops. Maven W. So here you go. So it's going to prompt me for my first name. I can spell it right. Brian Demers email address octa.com and my company is octa. So this will go ahead and send me an email with a new account. But it's also going ahead and create a new OIDC application in octa as well as configure everything for my local machine here. So I can see the new file that was created if I go to source main resources and my application of properties. And of course this would work with an application.yaml as well. And here we go. So you can see my new OAuth details. Of course you shouldn't keep secrets in your files. And of course after this I'll have to go delete this secret so nobody has it. So those are the hard parts. So now let's just create a simple rest endpoint. So I'm going to open up my favorite IDE. So I can drill down into my project. I can view that simple main class. And to keep things simple I'm going to add a rest controller directly in here. So if I do rest controller and static class simple controller. And then I'm going to add a simple single get mapping. And I'm going to call it welcome and it's going to return a string. I'm going to return hello. But we want to do a little more than that, right? So we want to add some sort of user identification so we can prove that we're logged in. So we can do principle and then I can do principle.getname. Now that's all I need to do. I can start my app right now and everything will work. I'm going to head over to local host. And now I can log in with the email address that I've used when I registered. And then I'll get redirected back to my application local host 8080. So the first time you register whether using our Maven plugin or through a registration form you'll get an email and you'll set up your account for the first time. And then you'll be able to log in just like this. So you'll see here I'm saying hello to some almost random string. So this is my user's unique ID. But that's not very pretty. It's great for maybe a primary key in a database but not for me to look at. So the next thing we're going to do is we're going to change this to my name. So let's jump back into our IDE. I'm going to change this to an OIDC user. And I also need to use the annotation authenticated principle. Otherwise it won't work. And now I can change this to get full name or any of these other attributes that you like. So I can get my family name which is my last name, my email, a bunch of other attributes. So let's just do hello and the name. So if I restart my application. This would take no time at all. And then I can bounce back into my browser. And you'll see I'm already logged in because I've logged in already. And here we go. Hello Brian DeMers. So in this video I've done a few things. I've created a new Spring Boot application. I've registered for a new Octa account. I've created an Octa OIDC application. And then I've configured my application of properties file to use those configuration values. And I've added a REST controller and added some security information into the REST controller to prove that the user is indeed logged in. If you want to see more, you can go to the project's GitHub page. So Octa developer slash Octa Maven plugin. And you can see all the steps that I've performed today. You can cut and paste right from here. That's it for this video. Be sure to hit the like and the subscribe button below. We have videos coming out weekly and you don't want to miss the next one. Thank you.