Rails API: Token Authentication Part 1 - [006]

  Рет қаралды 51,137

CodeOps Show

CodeOps Show

Күн бұрын

We show you how to setup token authentication in your rails app. We use devise to do the authentication and we install another gem to help us with enabling token authentication in our app!
#RUBYONRAILS #API #JWT
Rails API Series:
• Rails API
Next Episode: • Rails API: Token Authe...

Пікірлер: 47
@toddohanian3342
@toddohanian3342 6 жыл бұрын
Great video series, short and to-the-point lessons. Subscribed!
@miveronese
@miveronese 7 жыл бұрын
Thank you! You are an awesome teacher and yours is the best tutorial I've found. I'll definitely subscribe to Codemy.
@joshkuehn4243
@joshkuehn4243 7 жыл бұрын
Great stuff. I'd recommend using a larger font in the future. Thanks again!
@KiffinGish
@KiffinGish 6 жыл бұрын
Great show, thanks! (Hint: try not to say 'basically' too often)
@ashishgaur1398
@ashishgaur1398 2 ай бұрын
Best videos series will be which shows how backend development is done in the real companies :D. There are actually few paradigms like pair programming, design docs discussion, etc
@seanross1067
@seanross1067 6 жыл бұрын
Hey Zack, using your method here, it looks like you are adding an authentication_token column to the Users table. So for any subsequent request this requires looking up a record in the db for token validation, so you are maintaining state. Since a big motive for token authentication is to avoid persisting server-side data, do you know an alternative way to do this without having to access the db? Perhaps with JWT's/checking token signature using the rails secret_key_base? Thanks!
@rjsnh1522
@rjsnh1522 6 жыл бұрын
great video but I am not able to find 007 and 008 video lecture in your playlist it starts from 009 . can u help me with that please
@nachocapuccio
@nachocapuccio 6 жыл бұрын
Which theme are you using on VS Code??
@MiguelDiganchi
@MiguelDiganchi 5 жыл бұрын
I have a question. It is in every request that I need to send the token? Or just in the requests that will access to "authenticatable" resources?
@technoself81
@technoself81 4 жыл бұрын
Does this work alongside a rails app with an existing front end?
@videoeditorshiva
@videoeditorshiva Жыл бұрын
Do i get ask you direct doubts and get answers if i get membership?
@hectorgool
@hectorgool 5 жыл бұрын
In the devise docuntation page says: "To set up a controller with user authentication, just add this before_action (assuming your devise model is 'User'):" and i add this: before_action :authenticate_user!, but not work, how can i set up a controller with user authentication?
@jerroldthompson5889
@jerroldthompson5889 6 жыл бұрын
At 9:02 in the video: if user&.valid_password?('my_password') The Safe Navigation Operator '&.' is really quite nifty, and the current stable release of Ruby is 2.4.1 as of today----so has been around for a couple of years, but still would have been useful to point out this is a newer feature to the language only available since Ruby 2.3.0. Just mentioning the name of what it is, rather than saying "this is the same as this" would be a more lucid approach.
@zeeshanmattu1209
@zeeshanmattu1209 2 жыл бұрын
please let me know how i can become a member of this channel
@mariocardenas9983
@mariocardenas9983 6 жыл бұрын
why are you not using devise super class ? what's the point have it on gemfile ?
@mariocardenas9983
@mariocardenas9983 6 жыл бұрын
these from the original devise's controllers, but you are used custom controllers not inherited from Devise :s just that. PD: sorry if my english come with some grammatical mistakes.
@nachocapuccio
@nachocapuccio 6 жыл бұрын
Hi! Could you share your iTerm color & font customization? Thanks!
@nachocapuccio
@nachocapuccio 6 жыл бұрын
Thanks dude! One last thing ... Do you have the command prompt customization also?
@user-er8cw5cz6z
@user-er8cw5cz6z 6 жыл бұрын
Can anybody help me find part 2 of this video?
@shufflepack
@shufflepack 2 жыл бұрын
Its no longer 9 bucks a month, it is now 9 bucks for a weeks trial :P
@braulioramirez7772
@braulioramirez7772 6 жыл бұрын
I can´t find the video [007], where can I find it?
@HolyDropBear
@HolyDropBear 6 жыл бұрын
This is so evil...
@borasumer
@borasumer 4 жыл бұрын
Hope he warned us before we start this tutorial, so that we wouldn't have realize the fact that this is actually a paid tutorial since you can not access some parts of it without paying which is completely okay that he sells his videos, but the way he does this is kinda disgusting to my morality. If you want to sell the videos, just sell them, and post some intro videos here, not almost all of the video content, but not the most important parts, that is so evil as it was told in another comment. Good luck, hope you find a better way to make your money.
@videoeditorshiva
@videoeditorshiva Жыл бұрын
I'm using rails 7
@usamasohail7636
@usamasohail7636 Жыл бұрын
I am trying to see some rails videos and it says "members only". How can I get membership?
@usamasohail7636
@usamasohail7636 Жыл бұрын
@@codeops-show Option still not showing on desktop
@codeops-show
@codeops-show 6 ай бұрын
Started publishing all the members videos to public.
@andriyabu
@andriyabu 2 жыл бұрын
hii, SimpleToken authentication support has been removed from Devise for security reasons. do you have another solution for that.
@andriyabu
@andriyabu 2 жыл бұрын
Ooo I see. Thank you.
@pratipalsingh9606
@pratipalsingh9606 3 жыл бұрын
Where is remaining part of token authentication
@KiffinGish
@KiffinGish 6 жыл бұрын
At 12:24 I'm getting an error "NameError: undefined local variable or method `acts_as_token_authenticatable' for User"
@KiffinGish
@KiffinGish 6 жыл бұрын
Yes of course. I managed to get things working though by changing the statement in my application controller to this: acts_as_token_authentication_handler_for User, fallback_to_devise: false Hope this helps.
@rjsnh1522
@rjsnh1522 6 жыл бұрын
after installing the gem and adding acts_as_token_authenticatable u need to restart the server as. the methods from simple token is not going to load automatically . so it needs a server restart
@manuelt.227
@manuelt.227 4 жыл бұрын
maybe you already know the answer but I was having the same problemn and I restarted the server and did spring stop and that make it work
@learnrails3712
@learnrails3712 6 жыл бұрын
If we use devise in api and try to login with endpoint the devise related attributes are not updating like sign_in_count as such. Can anyone help on it. How to use devise for api.. this video is good but rest are paid videos...could not afford those any help is appreciated.
@learnrails3712
@learnrails3712 6 жыл бұрын
Yes but, for api I have written my own login endpoint if user.valid_password?(password) user.authentication_token = SecureRandom.base64(30) user.save render status: 200, json:{result: "success", status: "1", user_details: user} else render status: 200, json:{result: "Wrong passwod. Try agin.", status: "2"} end
@milk_steak_the_original
@milk_steak_the_original 3 жыл бұрын
Adding `acts_as_token_authentication_handler_for User` to my application_controller breaks things. I get #
@lucasluizm
@lucasluizm Жыл бұрын
How I send these email and password in postman??
@dreamaccess674
@dreamaccess674 7 жыл бұрын
hello can somebody help me to resolve this error please ? Can't verify CSRF token authenticity. Completed 422 Unprocessable Entity in 1ms (ActiveRecord: 0.0ms)
@pedroaraujo1508
@pedroaraujo1508 6 жыл бұрын
Same issue here...
@jhonatanleao5253
@jhonatanleao5253 6 жыл бұрын
Create rails app with api only params?
@rabinpoudyal8184
@rabinpoudyal8184 7 жыл бұрын
user = User.where(email: params[:email]).first ... Please answer my question.. why did you chain .first method here.. ?
@emmanuelasante8640
@emmanuelasante8640 7 жыл бұрын
User.where() returns an array. In this case it will return an array of one element. Chaining .first on will get the only element.
@misterriixl
@misterriixl 6 жыл бұрын
User.find_by_email(params[:email]) is other option
@ArthurPhila
@ArthurPhila 6 жыл бұрын
good vid, a little repetitive at times. we're not that stoopid xD
@cvnikita1
@cvnikita1 6 жыл бұрын
i think that gem is out of date
@csoalh20
@csoalh20 6 жыл бұрын
Do you know when you'll update it?
Rails API: Token Authentication Part 2 - [007]
6:34
CodeOps Show
Рет қаралды 882
rails devise jwt auth tutorial for rails api only mode
51:46
Dakota Martinez
Рет қаралды 5 М.
Whyyyy? 😭 #shorts by Leisi Crazy
00:16
Leisi Crazy
Рет қаралды 20 МЛН
FOOLED THE GUARD🤢
00:54
INO
Рет қаралды 35 МЛН
TRY NOT TO LAUGH 😂
00:56
Feinxy
Рет қаралды 14 МЛН
She ruined my dominos! 😭 Cool train tool helps me #gadget
00:40
Go Gizmo!
Рет қаралды 52 МЛН
Rails API: Setting up Devise Authentication - [004]
7:01
CodeOps Show
Рет қаралды 42 М.
Rails 5 JSON API with JSONAPI-resources
14:13
LINUXANDCHILL
Рет қаралды 16 М.
Rails API Series: Our First API
14:52
GoRails
Рет қаралды 25 М.
Episode #051 - Rails API - Authentication with JWT
7:37
Drifting Ruby
Рет қаралды 30 М.
Rest API - Best Practices - Design
15:50
High-Performance Programming
Рет қаралды 97 М.
ПЕРЕХОЖУ НА НОВЫЙ ТЕЛЕФОН!
10:34
DimaViper Live
Рет қаралды 44 М.
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 20 МЛН
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 6 МЛН
DC Fast 🏃‍♂️ Mobile 📱 Charger
0:42
Tech Official
Рет қаралды 484 М.