Okta in Spring Boot implementation with Spring Security and oauth2 | LIVE DEMO | Code Decode

  Рет қаралды 37,482

Code Decode

Code Decode

Күн бұрын

In this example we have explained Okta Spring boot with oauth2 and Spring Security.
Udemy Course of Code Decode on Microservice k8s AWS CICD link:
openinapp.co/u...
Course Description Video :
yt.openinapp.c...
Next Level App download link : next-level.one...
Create an Account in Okta
Login / Register to developer.okta...
Okta is our - Authorization server. It will provide us Access token to access our secured APIs.
Okta internally uses Oauth2.0 as underlying protocol for security implementation.
Okta provides a pre-configured custom authorization server called default.
You can register or login with Google / Github etc.
After successful registration , Next you need to create an application
Click on 3 lines in top left corner there u can see application dropdown
Click on applications
Then click on Create App Integration and choose the type of authorization method you want to use.
We need API Services
Interact with Okta APIs using the scoped OAuth 2.0 access tokens for machine-to-machine authentication.
Name your application
After that remember to save imp information - such as client credentials, client secrets, and Okta domain id that will be used later for our application
Client Id = Our public identifier to the OAuth flows.
Secret Id = Password for the client ID.
Okta Domain ID = The ID of the organization where our application is located.
Next Go to the Security tab and click on the API section
Here we have the following properties: authorization server name, audience, and issuer URI.
Audience = the claim aud to identify the recipient that the JWT is intended for.
Authorization server name = the name of the authorization server. In this case, I’m using the default one, but you can also create your own authorization server with the proper policies, scope, and claims.
Issuer URL is a unique identifier and a point to provide important metadata about the server, including a request for a token by adding the /v1/token path.
Create Spring Boot Application
Create a Spring boot project
Add Okta starter dependency - okta-spring-boot-starter - This will add all required classes for securing Spring application
Now we need to configure the API, adding some properties to our application.yml.
Now if you try to run Application - it will create error - Your Okta Issuer URL is missing. You can copy your domain from the Okta Developer Console
okta:
oauth2:
issuer: ${yourDomainId}/oauth2/default
Now after Securing the Application. Create any controller and rest endpoint.
Secure your Spring Boot Application
You will not be able to access the Get request also with okta implemented
To Test your application now - Try hitting through postman and u can see 401 - unauthorised
Create Custom scope as “ custom “ in okta.
use it to get token and use that token in apis.
In order for someone to make a request to your API, they need an access token. How an access token is obtained depends on the client making the request
Most Asked Core Java Interview Questions and Answers: • Core Java frequently a...
Advance Java Interview Questions and Answers: • Advance Java Interview...
Java 8 Interview Questions and Answers: • Java 8 Interview Quest...
Hibernate Interview Questions and Answers:
• Hibernate Interview Qu...
Spring Boot Interview Questions and Answers:
• Advance Java Interview...
Angular Playlist: • Angular Course Introdu...
SQL Playlist: • SQL Interview Question...
GIT: • GIT
Subscriber and Follow Code Decode
Subscriber Code Decode: www.youtube.co...
LinkedIn : / codedecodeyoutube
Instagram: / codedecode25
#okta#springsecurity #codedecode

Пікірлер: 138
@Trishaptesh
@Trishaptesh Жыл бұрын
I have started preparing for job interviews and following all the videos you uploaded in this channel from past fews day. I must say you did a great job here. Thank you for all the hardwork you are putting and keep sharing your valuable knowledge with us. Thanks.
@CodeDecode
@CodeDecode Жыл бұрын
Means a lot to us 🙏🙏. Keep learning keep shining Man 🌟🌟🌟🌟
@RavikiranKada-e9p
@RavikiranKada-e9p 10 ай бұрын
One of the best videos on OAuth 2.0 I have come across. Thank infinitely
@CodeDecode
@CodeDecode 10 ай бұрын
Thank you so much
@shalinisharma8122
@shalinisharma8122 Жыл бұрын
Great explanation and in depth coverage of the topic. May GOD bless you. Doing a great job.
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Shalini 🙂👍
@gayatrimamidwar8364
@gayatrimamidwar8364 Жыл бұрын
I was looking for okta nd understood from beginning to end. Thanks a lot dear🥰.. learning a lot from your videos
@CodeDecode
@CodeDecode Жыл бұрын
Glad to hear that Gayatri 😊👍
@vuttianusha5540
@vuttianusha5540 8 ай бұрын
Yet another great video!! I have been following your videos and content. It's been amazing. Thank you soo much for your time and effort. Please upload the next part of this that is securing only post apis and not get apis.
@CodeDecode
@CodeDecode 8 ай бұрын
Sure 👍Thanks 👍
@ashishshriwatri9
@ashishshriwatri9 Жыл бұрын
I feel like CODE DECODE become university. Thank You.
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Ashish 😊👍
@bavana541
@bavana541 Жыл бұрын
Excellent video.. really appreciate your efforts to explain in detailed manner ..its very clear so that fresher can also learn without any difficulty..god bless you sister.
@CodeDecode
@CodeDecode Жыл бұрын
Thanks for the motivation bavana
@timtim9o5
@timtim9o5 Жыл бұрын
Thank you! To me this was a lot more straight-forward than keycloak, and you explained it very clearly.
@CodeDecode
@CodeDecode Жыл бұрын
Thanks 😊👍
@nishantlakhara
@nishantlakhara Жыл бұрын
you are a time saver. very clear and crisp explanation.
@CodeDecode
@CodeDecode Жыл бұрын
Thanks 🙏🙏👍👍
@robinbhargava111
@robinbhargava111 Жыл бұрын
Very informative video to learn about Okta and token generation.
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Robin 😊
@jagan1957
@jagan1957 6 ай бұрын
Thank you so much for the amazing insights into the profiles.... Highly helpful and educative. Keep creating more content.
@manishkartik1275
@manishkartik1275 7 ай бұрын
Hello Maam your lectures helped me a lot to crack big tech companies interview round Thanks a lot for this can you please do a session for MYBatis also
@deeptyrajput8343
@deeptyrajput8343 8 ай бұрын
Thanks for the video. Please upload further videos related to security configuration and all.
@pratikkurbet3437
@pratikkurbet3437 Жыл бұрын
Just watching Okta content and your popped up thanks 🙏
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Pratik 🙂🙂👍
@subbu.kurapati3575
@subbu.kurapati3575 Жыл бұрын
Excellent content video. Please provide continution madam🥰👌👌
@CodeDecode
@CodeDecode Жыл бұрын
Thank :)
@Vithal_Nivargi
@Vithal_Nivargi Жыл бұрын
Thanks mam nicely explained 🙏. and please bring other videos on this concept like custom configuration. and implement such way that we can use it in Enterprise application level. Thanks
@CodeDecode
@CodeDecode Жыл бұрын
Sure we will do that👍👍🙂
@swapnilchavhan480
@swapnilchavhan480 Жыл бұрын
Thank you very well explained in short video ,please make details series about security
@CodeDecode
@CodeDecode Жыл бұрын
Sure Swapnil 👍
@veera-fb9or
@veera-fb9or Ай бұрын
Wow Great Explination 👍👍👍👍👍👍
@praveens2272
@praveens2272 5 ай бұрын
Indian youtubers are on direct point
@CodeDecode
@CodeDecode 5 ай бұрын
Thanks
@tanson86
@tanson86 Жыл бұрын
Yes. I want a video on the implementation you referred to in the last 1 minute ie integrating okta with webszcurtiyconfigureadapter and ant matchers for bypassing certain end points.
@CodeDecode
@CodeDecode Жыл бұрын
Sure Tanson 👍👍
@thepowerofanime4619
@thepowerofanime4619 2 ай бұрын
Good video. I am jot sure if u will make the next part of it.
@misjmadura
@misjmadura Жыл бұрын
Your contents are amazing and so useful. I have been watching them recently and learning so much from you. Really Appreciate your efforts. Could you please share the link of next part of this video if it is uploaded? Thank you again.
@aishurajas2507
@aishurajas2507 2 ай бұрын
Hi code decode member, I really want to learn from you. Do you conduct offline trainings?
@VishnuVardhan-pe7lj
@VishnuVardhan-pe7lj Жыл бұрын
Hey!!!! Your way of presenting is too good.
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Vishnu 🙂🙂
@RjDBIIPL
@RjDBIIPL Жыл бұрын
i learned a lot from you ,tqsm🌹
@CodeDecode
@CodeDecode Жыл бұрын
I'm so glad! ❤️
@farhaankazi7134
@farhaankazi7134 5 ай бұрын
Please make more video on okta authentication and authorization for microservices communication including api gateway
@CodeDecode
@CodeDecode 5 ай бұрын
Sure 👍
@oldaccount137
@oldaccount137 Жыл бұрын
Very useful video as always , but one thing i want to know that how the internals of these works in spring application which filter , AuthenticationManager , provider are getting used to authorize client and storing Authenticated Objects if these things you explain in the next video will be awesome and will be next level of knowledge.❤️❤️❤️
@CodeDecode
@CodeDecode Жыл бұрын
Sure we will do that 👍👍
@soulfulGirl_
@soulfulGirl_ Жыл бұрын
@@CodeDecode Is this video available , if so can you pleaseee share it will be very helpful
@sudheerkumar-tp1mg
@sudheerkumar-tp1mg Жыл бұрын
Hi Mam, I am big fan of your channel, regarding SSO how to modify the already existing backend system because that systems already have user information which internally used in different parts of the application, please share any video on this.
@souravpaul6086
@souravpaul6086 Жыл бұрын
Hi, your videos are so informative I learned a lot from your videos thank you for making informative videos for us. I have a request could you please make a video where linkedin and twitter used as social login platform instead of okta that can be very useful. Please make a video on this topic
@sanjayshah3538
@sanjayshah3538 11 ай бұрын
Thank its very helpful knowledge, may i know how can we define in controller the. Specific endpoint can be access by scope(roles) which based while creating token, could you help me that to implement please.
@CodeDecode
@CodeDecode 10 ай бұрын
We will create video on that soon👍
@anjaniysalekar6727
@anjaniysalekar6727 Жыл бұрын
Love your content madam, love from Gujarat😊. Please make a same video with Keycloak too. Please make that video.
@CodeDecode
@CodeDecode Жыл бұрын
Sure Anjaniy 😃😃🙂👍
@anjaniysalekar6727
@anjaniysalekar6727 Жыл бұрын
@@CodeDecode thanks in advanced.
@siddharthpandey835
@siddharthpandey835 Жыл бұрын
Seriously Its awesome. Pls make more videos !!!!!!!!
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Siddharth 🙂🙂👍👍
@sriharshapaladugu3575
@sriharshapaladugu3575 Жыл бұрын
HI Nice explanation I have two questions: How can i have okta validation without "/okta" in url? How to extract user information and pass it to different function from jwt?
@Shreenidhi110
@Shreenidhi110 8 ай бұрын
just wow!,Excelent content,Thanks alot !
@rakeshpramanik
@rakeshpramanik Жыл бұрын
Thank you for all hard work .plz make an extension
@CodeDecode
@CodeDecode Жыл бұрын
Thanks . Sure Rakesh 👍👍
@mediss3720
@mediss3720 Жыл бұрын
Good exercice for okta jwt
@CodeDecode
@CodeDecode Жыл бұрын
thanks
@sandysworld7529
@sandysworld7529 Жыл бұрын
First comment and first like.. i waiting for this.. thank you mam
@CodeDecode
@CodeDecode Жыл бұрын
Thanks a lot🙂👍👍😃
@aasthasharma8593
@aasthasharma8593 Жыл бұрын
Very well explained!! Thanks to good video
@CodeDecode
@CodeDecode Жыл бұрын
Thanks Aastha ❤️
@vickybhoir3017
@vickybhoir3017 4 ай бұрын
nice explanation
@baskar.k
@baskar.k Жыл бұрын
Very good tutorial
@CodeDecode
@CodeDecode Жыл бұрын
Thanks
@saikiran3085
@saikiran3085 3 ай бұрын
Thank you so much
@CodeDecode
@CodeDecode 3 ай бұрын
You're most welcome
@AnjaliPatel-b8r
@AnjaliPatel-b8r 3 ай бұрын
Can you create a demo with new authorization server please?
@monishad7040
@monishad7040 7 ай бұрын
Thank you for your efforts and I am getting 404 error. { "error": "invalid_dpop_proof", "error_description": "The DPoP proof JWT header is missing." } Could you please help me.
@albertraja7449
@albertraja7449 7 ай бұрын
Getting same error
@SoyJavero
@SoyJavero Ай бұрын
same could you solve it?
@agrawalparimal7283
@agrawalparimal7283 14 күн бұрын
​@@SoyJavero that's because you must have selected Proof of Possession while creating an app, you can modify it, it will be below client secrets in general settings, so uncheck it!
@everyone2905
@everyone2905 Жыл бұрын
Please attach a link in the comments of Single sign on, which you said you'll discuss in next video, i can't find by searching on your channel.
@dasithasandaruwan6002
@dasithasandaruwan6002 Жыл бұрын
Hope you will do the user registration part too, thanks
@CodeDecode
@CodeDecode Жыл бұрын
User registration part? Can u plz elaborate?
@WHITE-ci5mv
@WHITE-ci5mv Жыл бұрын
Hi, I follow the steps in the video but while generating the token using postman i am getting below error: "error": "unsupported_grant_type", "error_description": "The authorization grant type is not supported by the authorization server. Configured grant types: [client_credentials]." what could be issue here?
@mahendragoud8406
@mahendragoud8406 4 ай бұрын
Hello mam Currently its showing error at 16:22 The DPoP proof JWT header is missing please provide a way to resolve this
@SoyJavero
@SoyJavero Ай бұрын
same could you solve it?
@agrawalparimal7283
@agrawalparimal7283 14 күн бұрын
that's because you must have selected Proof of Possession while creating an app, you can modify it, it will be below client secrets in general settings, so uncheck it!
@ahammedhussain9335
@ahammedhussain9335 9 ай бұрын
Can we have a securityconfig class video please ?
@pottendlanagma7263
@pottendlanagma7263 5 ай бұрын
In recent time DPoP came into picture for JWT token and this example is not working. i am getting "invalid_dpop_proof" error. It would be great if you could make a video about this issue.
@SoyJavero
@SoyJavero Ай бұрын
same could you solve it?
@agrawalparimal7283
@agrawalparimal7283 14 күн бұрын
that's because you must have selected Proof of Possession while creating an app, you can modify it, it will be below client secrets in general settings, so uncheck it!
@RjDBIIPL
@RjDBIIPL Жыл бұрын
do you have a oauth2 with okta ODIC-openID web application without postman API, please post asap
@CodeDecode
@CodeDecode Жыл бұрын
What do you require exactly? Spring boot application?
@astar4782
@astar4782 Жыл бұрын
The Okta UI has changed.. can you show a sample with the latest UI ?
@CodeDecode
@CodeDecode Жыл бұрын
Sure👍
@hassanharera
@hassanharera Жыл бұрын
Great
@CodeDecode
@CodeDecode Жыл бұрын
Thanks😇
@omkarmhatre628
@omkarmhatre628 Жыл бұрын
Grate Video mam. Please make extension of this video. Thank you.
@CodeDecode
@CodeDecode Жыл бұрын
sure omkar we will create it soon
@crazyajay9289
@crazyajay9289 Жыл бұрын
do we have the extension of this video series?
@DattatrayBabar-w2e
@DattatrayBabar-w2e Ай бұрын
@codedecode The DPoP proof JWT header is missing. I'm getting this while generating token
@SoyJavero
@SoyJavero Ай бұрын
same could you solve it?
@agrawalparimal7283
@agrawalparimal7283 14 күн бұрын
that's because you must have selected Proof of Possession while creating an app, you can modify it, it will be below client secrets in general settings, so uncheck it!
@Varun-v8g
@Varun-v8g Жыл бұрын
Please create more content on oauth
@CodeDecode
@CodeDecode Жыл бұрын
Sure we will create it soon
@ujjwalmittal3122
@ujjwalmittal3122 Жыл бұрын
MORE VIDEO ON THIS PLEASE
@CodeDecode
@CodeDecode Жыл бұрын
Sure ujjwal we will create it soon
@ujjwalmittal3122
@ujjwalmittal3122 Жыл бұрын
Thank you Mam
@a.m.jyotiprakashsahu5754
@a.m.jyotiprakashsahu5754 Жыл бұрын
plz make one more video on okta..
@CodeDecode
@CodeDecode Жыл бұрын
Sure 👍👍
@you_shotzz
@you_shotzz Жыл бұрын
Can u show the role based also OIDC one
@vikashkumar-gv1dp
@vikashkumar-gv1dp 8 ай бұрын
🙏🙏🙏please upload one video for authorization_code as grant type🙏🙏🙏
@veera-fb9or
@veera-fb9or Ай бұрын
U Have any github account
@vempallireddybasha1302
@vempallireddybasha1302 Жыл бұрын
pls do customization auth server as well mam
@anithaluckas2635
@anithaluckas2635 Жыл бұрын
Can you please explain and upload the spring batch
@siddapure
@siddapure Жыл бұрын
I have created application in same way you explained but it's not working
@CodeDecode
@CodeDecode Жыл бұрын
Issue?
@siddapure
@siddapure Жыл бұрын
I have configured all as you told and getting torn from jwt token as well. When I pass this token as basic with JWT and passed credentials etc. But getting 401 from postman when I hit my application. Am I Missing anything?
@DattatrayBabar-w2e
@DattatrayBabar-w2e Ай бұрын
{ "error": "invalid_dpop_proof", "error_description": "The DPoP proof JWT header is missing." } what can be done in this case, while generating token
@SoyJavero
@SoyJavero Ай бұрын
same could you solve it?
@agrawalparimal7283
@agrawalparimal7283 14 күн бұрын
that's because you must have selected Proof of Possession while creating an app, you can modify it, it will be below client secrets in general settings, so uncheck it!
@prisinha
@prisinha Жыл бұрын
6:00 Yes please create
@gauravjaiswal7923
@gauravjaiswal7923 Жыл бұрын
Can you please create the second part of this
@CodeDecode
@CodeDecode Жыл бұрын
Sure Gaurav 👍
@SajidhKareem
@SajidhKareem 11 ай бұрын
@@CodeDecode Yes pls. I need it desperately.
@funnyvideorocks
@funnyvideorocks Жыл бұрын
Can you please solve leetcode with basic logic
@CodeDecode
@CodeDecode Жыл бұрын
Sure we are already uploading many such videos on channel
@mohamednibras53
@mohamednibras53 Жыл бұрын
How to get access token for a specifc user ?
@CodeDecode
@CodeDecode Жыл бұрын
Access tokens have claims. Claims have user info. From front end get access token signing that specific user, you will then get all user info in your token itself
@mohamednibras53
@mohamednibras53 Жыл бұрын
@@CodeDecode in this video to get the access token you have passed username and password as client id and client secret. I have 5 users in the Okta directory. When i try to get access token by passing those users credentials, i cannot get access token. How to resolve this ?
@Shreenidhi110
@Shreenidhi110 8 ай бұрын
Please add the next video
@pillisasidharreddy8632
@pillisasidharreddy8632 Жыл бұрын
We want part2 of okta
@tamojitdutta993
@tamojitdutta993 Жыл бұрын
Pls create the next video for okta
@CodeDecode
@CodeDecode Жыл бұрын
Sure 👍👍
@sandysworld7529
@sandysworld7529 Жыл бұрын
Mam, please make extension of this video.. Thanks.
@CodeDecode
@CodeDecode Жыл бұрын
Sure 👍👍
@manishkartik1275
@manishkartik1275 7 ай бұрын
14:20 you will cry why you are not getting access token 🤣🤣
@shaikvaheed1730
@shaikvaheed1730 3 ай бұрын
I tried the same way what tou did for my project POC am getting the below error couldn't retrieve remote JWK set PKIX path building failed sun.security.certpath.suncertpathbuilderexception Please suggest what can be done for this issue
@BeAmbitious96
@BeAmbitious96 6 ай бұрын
Im getting below error { "error": "invalid_dpop_proof", "error_description": "The DPoP proof JWT header is missing." }
@SoyJavero
@SoyJavero Ай бұрын
same could you solve it?
@agrawalparimal7283
@agrawalparimal7283 14 күн бұрын
that's because you must have selected Proof of Possession while creating an app, you can modify it, it will be below client secrets in general settings, so uncheck it!
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 22 МЛН
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
火影忍者一家
Рет қаралды 106 МЛН
إخفاء الطعام سرًا تحت الطاولة للتناول لاحقًا 😏🍽️
00:28
حرف إبداعية للمنزل في 5 دقائق
Рет қаралды 58 МЛН
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
How to integrate Java Spring Boot application with Okta using OIDC?
36:10
Security in Action 101
Рет қаралды 8 М.
OAuth 2.0 Implementation with Spring Security and Spring Boot | Full Example
1:11:15
Single Sign-On with Spring Boot & Okta | OAuth 2.0 | Java Techie
12:12
OAuth2  & Spring boot 3 & Social login | never been easier
1:05:27
Bouali Ali
Рет қаралды 68 М.
Spring Boot + Spring Security + JWT from scratch - Java Brains
39:29
okay java | springboot saml and okta
26:46
okay java
Рет қаралды 24 М.
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 22 МЛН