Doorkeeper Devise API User Authentication | Ruby On Rails 7 Tutorial

Sdílet
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

Komentáře • 31

  • @Deanin
    @Deanin  Před 2 lety +7

    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!

  • @xarxlugner2991
    @xarxlugner2991 Před 2 lety +1

    Thank you dean! i can't wait for the next content

  • @Mixesha001
    @Mixesha001 Před 2 lety +7

    That’s some good stuff here. At the moment you probably make the most useful content in the rails community.

    • @Deanin
      @Deanin  Před 2 lety

      I appreciate that! Glad it was helpful 🙂

  • @matthewruvalcaba9735
    @matthewruvalcaba9735 Před 2 lety +1

    Thanks for sharing!
    I hope we get the react video soon!

    • @Deanin
      @Deanin  Před 2 lety +1

      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

  • @ingemarandrade277
    @ingemarandrade277 Před rokem +1

    Thank you so much for this tutorial! ❤

  • @learning9166
    @learning9166 Před rokem +1

    Thank you for this tutorial Deanin.

  • @orce
    @orce Před 2 lety +1

    OMG yes!
    this... pretty much this...
    you sir are the man!

  • @nshinsuke4919
    @nshinsuke4919 Před rokem

    Very helpful. Just subscribed your channel. Thank you very much.

  • @nadbwah282
    @nadbwah282 Před 2 lety +1

    Thank you so much for posting this video!! ❤️

    • @Deanin
      @Deanin  Před 2 lety +1

      I should be thanking you for supporting the channel! I hope the video is helpful! 🙂

    • @nadbwah282
      @nadbwah282 Před 2 lety +1

      @@Deanin yes it definitely is very helpful 👍🙏

  • @mundotennis
    @mundotennis Před rokem

    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)?

  • @xwaxy1753
    @xwaxy1753 Před 2 lety +1

    This is gold man, thx

    • @Deanin
      @Deanin  Před 2 lety +1

      Happy to help! Feels like one of those topics that everyone in the industry knows but nobody outside of it has covered lol

  • @v_gauther
    @v_gauther Před rokem +1

    Amazing video ! What kind of rails application did you generate ? Did you use the --api arguments ?

    • @Deanin
      @Deanin  Před rokem +1

      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.

    • @v_gauther
      @v_gauther Před rokem

      @@Deanin thx for your answer, that’s exactly what I was looking for

  • @sugamkarki697
    @sugamkarki697 Před rokem

    Hi, can you export your postman api config and add it to the repo too? It would be much easier then

  • @cleversonluizcorreiadesouz5959

    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!

    • @Deanin
      @Deanin  Před rokem +1

      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

    • @cleversonluizcorreiadesouz5959
      @cleversonluizcorreiadesouz5959 Před rokem +1

      @@Deanin Oh, I see... Thanks a lot for your time and for answering me... Cheers from Brazil!

  • @abdullahsaleh7196
    @abdullahsaleh7196 Před dnem

    Keep going mate🫡

  • @sayambar7307
    @sayambar7307 Před rokem +1

    Hi, Can you just explain the requirement of oauth_access_grants table?

  • @jouzou3709
    @jouzou3709 Před 2 lety +1

    hai dean, can you make pure backend rails for like todos app and conect to react website

    • @Deanin
      @Deanin  Před 2 lety +1

      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

    • @jouzou3709
      @jouzou3709 Před 2 lety +1

      @@Deanin thanks appreciate it

  • @dbdb3267
    @dbdb3267 Před 2 měsíci

    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 ?

  • @marcusl16
    @marcusl16 Před 2 lety +4

    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