 So my name is Matt Raebel and this is a screencast showing you how to get started with Spring Boot, OAuth 2.0, and Okta. I would encourage you to look in the description for this video to see if there's a new version of it and if not then you're on the latest and greatest right here. And this video will also be embedded in this blog post so if you go to developer.okta.com slash blog then you'll be able to see this video right here. So to get started with Spring Cloud Security, or I should say Spring Cloud Security is actually started by the good folks at Pivotal and it became part of Spring Boot built on Spring Security and OAuth. So they have this quick start guide that I'll show you. Makes it very easy to get started using Groovy. You simply have the Spring Boot Starter Security with Hello World and this tutorial is largely based on that. So to create a secure Spring Boot app, it's really easy to use an SDK man or homebrew. So if you're on a Mac you can just install Pivotal's tap and Spring Boot and then you can create a HelloWorld.groovy file that has a controller. So I already have this part done as far as installing the Spring CLI. So I'm going to make a directory called Okta OAuth and then CD into it and then I'll create HelloWorld.groovy and you'll see that grab annotation is used to grab Spring Boot Starter Security. It's a REST controller and it just has a simple mapping to say Hello World. So if we start this up using Spring Run HelloWorld.groovy then you'll basically navigate to localhost 8080 and you'll see you're prompted for username password. The default username is user and then the password is over here, printed to the console. So we have that working where it says Hello World. So back to the tutorial that you'll notice it says to get your authorization server setting. So log into your Okta account, mine is at dev-158606 and if you don't see a screen like this when you log in chances are you have the classic UI enabled so you want the developer console enabled and if you go to API authorization servers you'll see your issuer URI, the name and the audience and if you go to this metadata URI you can get all the different token endpoints and authorization endpoints you need for Spring Security OAuth. So the first thing you'll need to do is create an OpenID Connect app in Okta. So go back here, click applications and then click add application and then web and then we'll call it Spring OAuth and the base URI doesn't really matter but for the login redirect URI you want login and then click done and then you'll notice it has a client ID and a client secret at the bottom you're going to need those. So to go back here and we'll create a new file called hellooauth.groovy. So if you look at hello world you'll notice it's not that much different. The only difference is the enable OAuth to SSO annotation so we can actually copy this one to hellooauth and just via the hellooauth one grab that annotation and because you added that enable OAuth to SSO annotation Spring Security looks for a number of properties. So the cool thing is if you aren't logged in to your Okta account this is the data you see but if you refresh after you've logged in it actually populates it with your information you'll notice it has my domain in there now. So we can go here and create an application.yml and then you'll want to remove these comments and then we'll get the client ID and client secret from over here, client secret save that and then run Spring, run hellooauth and I'll log out of here so you'll see that it actually does prompt to log man so I'll go to localhost 8080, it redirects me to Okta and logs me and it says hello world. Let's make that a little better let's go ahead and actually show the user's name so instead of just home hello world do a little bit better than that and we'll print out the user.name from the principles now same Spring run hellooauth and now it should say hello Matt Rabel or Okta demo whoever I log in with there you are it says hello Okta demo so all the source code for this is on GitHub Okta Spring boot OAuth example that's it so I hope you enjoyed this quick screencast and let me know if you have any questions using Okta. Cheers.