Questions tagged [devise-token-auth]

Token-based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth. Use this tag for questions related to Devise Token Auth.

Token-based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth. Use this tag for questions related to Devise Token Auth.

136 questions
2
votes
0 answers

What is the difference between using a gem like devise_token_auth and devise_jwt?

I have a rails api only application that I want to use devise for the authentication. I came across this decision and I want to know which one is better. Would it make sense for a high volume web application to use something like devise_token_auth…
2
votes
1 answer

How we pass the headers inside swagger rspecs

I'm getting this error when I run the rspec Response body: {"success":false,"errors":["Invalid login credentials"]} here is my code path '/api/auth/validate_token' do get 'check token' do tags 'TokenValidations' consumes…
djadam
  • 649
  • 1
  • 4
  • 20
2
votes
1 answer

No route matches "omniauth/:provider" when using devise, omniauth and devise-token-auth

I'm trying to allow my users to login with their Google accounts using devise, omniauth and devise-token-auth. To do so I have added the following code to the rails API-only boilerplate. # Gemfile ... # authentication gem 'devise', '~> 4.7' gem…
Gumbee
  • 53
  • 1
  • 5
2
votes
0 answers

Rails Devise Token Auth Reset Password Flow - How to deep link from 302 redirect

I am trying to implement a reset password flow with devise token auth gem: https://github.com/lynndylanhurley/devise_token_auth The end client will be a mobile device (e.g. iOS, Android). I am uncertain as to how the native clients will be able to…
Abhas Arya
  • 470
  • 1
  • 5
  • 19
2
votes
1 answer

Rails with Devise Token Auth uninitialized constant Users

I am using rails with devise token auth. i want to implement omniauth but it keeps me asking uninitialized constant user routes.rb namespace :api, defaults: { format: :json } do scope :v1 do mount_devise_token_auth_for 'User', at:…
Arif Ikhsanudin
  • 739
  • 6
  • 14
2
votes
0 answers

Customized hash for nested attributes errors in rails

I have addresses & phones associations against the user model which means that a user can have multiple addresses and multiple phones. I have to store 1 address and 1 phone at the time of signup where I am using devise_token_auth…
2
votes
1 answer

Devise token auth skip update auth header on deleting user

I'm using devise_token_auth 1.1.3 and devise 4.4.3 together in my Rails application and I'm trying to remove the current user. My users are called 'staff'. The problem is when I try and delete the current user it tries to update the auth header for…
map7
  • 5,096
  • 6
  • 65
  • 128
2
votes
2 answers

Is their an authentication library similar to Devise that supports API only rails applications but also refresh tokens?

I keep seeing lots of tutorials for Rails API services where they just bring back session cookies and use lots of configuration of Devise. I'm not opposed to using Devise Token Auth but as far as I can tell, it doesn't support JWTs. I want JWT…
aarona
  • 35,986
  • 41
  • 138
  • 186
2
votes
1 answer

Azure AD authentication with Rails and devise

I have a rails app with devise configured and mongodb database. I want to configure Microsoft azure AD for authentication. When the user enters my project url and the user is not signed in, it should redirect to azure AD's sign in page and when the…
2
votes
1 answer

API JSON Response serialize to throw custom message

I am using devise token auth gem along with active model serializer to authenticate, which sends response like { "status": "Success", "message": "User Created Successfully", "data": { "id": 9, "tokens": { …
2
votes
0 answers

Devise token auth another user login

I am developing an application through Rails. I need the ability to login to another user with admin account in devise token auth gem When user log in, authHeaders are stored in the browser cookie. Determine user by authHeaders value. ex) {…
2
votes
0 answers

RuntimeError (No resource_class found)

Creating a Rails API using Devise_token_auth gem and trying to make it omniauthable to be able to login through google and facebook. Following this :- github. This error has been registered with no solution yet Here . My error :- `Started POST…
2
votes
1 answer

devise_token_auth always returns 401 Unauthorized

I'm working on an Angular app with a Rails API. I'm using Devise Token Auth and the 6.x branch of angular-token. I can CRUD users with no problem, and I can sign in, but when I try to access a restricted resource (one restricted through the…
Niek
  • 1,464
  • 1
  • 17
  • 27
2
votes
1 answer

What does `client` header value represents in devise_token_auth

I am trying to implement token based authorization in rails, with devise_token_auth (https://github.com/lynndylanhurley/devise_token_auth#conceptual). When I post uid and password against sign_in method, it returns access-token, client (and uid…
Yuki Inoue
  • 3,569
  • 5
  • 34
  • 53
1
vote
0 answers

ActionController::InvalidAuthenticityToken in Devise::RegistrationsController#create

I just installed devise and below is the specific error that I'm getting: Which is weird because I have <%= csrf_meta_tags %> inside the head tags of my application.html.erb file & <%= form_authenticity_token %> in all my forms. Below are all the…
1
2
3
9 10