question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing Authorization headers after login success

See original GitHub issue

I flow the sample chat app. and integrating react-admin with my feathers app but it always on the login page. the code looks like this

import React from ‘react’; import { Admin, Resource } from ‘react-admin’; import feathersClient from ‘./feathersClient’; import { PostList, PostEdit, PostCreate } from ‘./messages’; import { restClient, authClient } from ‘ra-data-feathers’;

const restClientOptions = { id: ‘_id’, // In this example, the database uses ‘_id’ rather than ‘id’ usePatch: true // Use PATCH instead of PUT for updates };

const authClientOptions ={ storageKey: ‘token’, // The key in localStorage used to store the authentication token authenticate: { // Options included in calls to Feathers client.authenticate strategy: ‘local’, // The authentication strategy Feathers should use header:‘Authorization’, }, permissionsKey: ‘permissions’, // The key in localStorage used to store permissions from decoded JWT permissionsField: ‘roles’, // The key in the decoded JWT containing the user’s role passwordField: ‘password’, // The key used to provide the password to Feathers client.authenticate usernameField: ‘email’, // The key used to provide the username to Feathers client.authenticate }

const App = () => { return ( <Admin title=‘ra-data-feathers Example’ dataProvider={restClient(feathersClient, restClientOptions)} authProvider={authClient(feathersClient, authClientOptions)}

<Resource name="messages" list={PostList} edit={PostEdit} create={PostCreate} /> </Admin> )};

export default App;

**Response error message:

{"name":"NotAuthenticated","message":"No auth token","code":401,"className":"not-authenticated","data":{},"errors":{}}**

Screen Shot 2019-07-06 at 5 00 10 PM

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
hunghtcommented, Jul 7, 2019

I fixed it by adding storage:localStorage option to my feathers client

1reaction
brahyamcommented, Oct 8, 2019

For me it was fixed by adding ‘feathers-jwt’ as the storageKey name in my auth client options since is the default that the feathers auth client uses.

const authClientOptions = {
  storageKey: 'feathers-jwt'
};

const App = () => <Admin
  dataProvider={restClient(feathersClient, restClientOptions)}
  authProvider={authClient(feathersClient, authClientOptions)}/>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing Authorization header when send http request from ...
I have an application in nodejs with jwt authorization, when I send a get from posman the authentication header is found but when...
Read more >
Why authorization header not included in request ? - Auth0
After successful login, it redirects me to the private end point and I get 401 Un-authorized error. Whenever I make this request with...
Read more >
Fix Site Health Error: The authorization header is missing
Quick post that explains how to fix the error, “The authorization header is missing”. This error may be found under “recommended improvements” ......
Read more >
Missing Authorization header in OAuth access token request
Hi - I have an proxy flow set up for OAuth authentication where Apigee is proxying for our internal identity store.
Read more >
Authentication - RestRserve
Note that Basic authentication, should only be used over HTTPS (SSL) or within secure network. In HTTP protocol Authorization header (as well as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found