Doorkeeper Devise API User Authentication | Ruby On Rails 7 Tutorial
Vložit
- čas přidán 19. 05. 2024
- This tutorial covers creating a Rails authentication solution that allows you to login to your regular Rails app AND your Rails API! This solution is scalable for multiple API's, and includes solutions to common problems such as logins from mobile devices and issuing client ID and client secrets.
In the future, this tutorial will hopefully be used to create more advanced React, Vue, and React Native API applications.
Nejdetkadir's Demo: github.com/nejdetkadir/devise...
Nejdetkadir On Twitter: / nejdetkadirr
RubyYagi Blog Post: rubyyagi.com/rails-api-authen...
Doorkeeper Gem: github.com/doorkeeper-gem/doo...
Bootstrap 5: getbootstrap.com/docs/5.0/get...
Rack-Cors: github.com/cyu/rack-cors
Source Code: github.com/Deanout/doorkeeper
Join this channel to help support these videos:
/ @deanin
Follow me on social media:
linktr.ee/deanin
Join this channel to get access to perks:
/ @deanin
If you liked this video, please consider subscribing: t.co/RZ4EwP0F2a
Timestamps
0:00 Intro And Doorkeeper Multi-Access Demo
3:10 Creating The Core Rails Application
13:03 Adding Doorkeeper To The Rails Application
25:08 Create The API Application Controller
27:12 Creating The API Only Books Controller Facade/BFF
30:30 Creating The Doorkeeper API Users Registrations Controller
42:06 Creating The Android API, Admin Only Facade/BFF
45:57 User and Oauth Token Creation And Revokation.
55:14 Adding Rack-Cors Gem To Restrict Access By IP/Request
#Deanin #Software #Programming
Just wanted to say thanks to Nejdetkadir (twitter.com/nejdetkadirr) for the demo for this project.
Also a big thank you to the channel members/patreon supporters who encourage me to stay up all night making these videos haha. You're all the best!
♥
Thank you dean! i can't wait for the next content
That’s some good stuff here. At the moment you probably make the most useful content in the rails community.
I appreciate that! Glad it was helpful 🙂
Thanks for sharing!
I hope we get the react video soon!
Working on it! I'm trying to build my own application so I have a bit of motivation for this project haha.
The biggest blocker for me is usually just getting the token authentication working. Considering how smooth this was, it shouldn't be too bad getting a proper video out by next week. Famous last words lol
Thank you so much for this tutorial! ❤
Thank you for this tutorial Deanin.
OMG yes!
this... pretty much this...
you sir are the man!
Very helpful. Just subscribed your channel. Thank you very much.
Thank you so much for posting this video!! ❤️
I should be thanking you for supporting the channel! I hope the video is helpful! 🙂
@@Deanin yes it definitely is very helpful 👍🙏
Thanks for the video! For production, should we add a separate controller to create Doorkeeper::Application per client so that we don't expose the client_id ('Web Client' client_id)?
This is gold man, thx
Happy to help! Feels like one of those topics that everyone in the industry knows but nobody outside of it has covered lol
Amazing video ! What kind of rails application did you generate ? Did you use the --api arguments ?
I think for this one I didn't use the --api argument, because people (myself included) have been wanting to know how to allow API login as well as regular login.
@@Deanin thx for your answer, that’s exactly what I was looking for
Hi, can you export your postman api config and add it to the repo too? It would be much easier then
Great content! Thanks a lot man... One thing that I don't quite understand was why did you create a namespace and a scope in your routes, what was the point? Thanks a lot!
It can help to keep things cleaner, but it was also just a chance to show people how to do it. It's one of those topics where a dedicated video probably wouldn't be something people would even know to search for because they might not know it's possible, so sometimes I'll stress it in other videos to give them exposure to the idea.
You could do the same thing without the scope or the namespace, it doesn't matter really
@@Deanin Oh, I see... Thanks a lot for your time and for answering me... Cheers from Brazil!
Keep going mate🫡
Hi, Can you just explain the requirement of oauth_access_grants table?
hai dean, can you make pure backend rails for like todos app and conect to react website
Yeah I have a much more involved React tutorial coming soon.
I think there's a tutorial on the channel for a pure todos app with Rails and React, but without any login. So if you want login, check back next week probably
@@Deanin thanks appreciate it
Thanks a lot.
Not easy to complete as other tutorials.
May be to improve it, you could show at the beginning the final result that we want to get.
Then start developing it ?
If you believe in God existence, He is surely guiding you, because this video arrives just in time, when I started my research about Api auth on r7 thank you so much for you and for mr nejdetkadir for providing this project