Search Posts

Category: jwt

Wait for authentication response from server before executing any Angularjs app

I have an AngularJS app (bootstrapped using ng-admin) contained within an admin backend where initial login to it is handled via LDAP. When the Angular app loads for the first time, it needs to make an API call (using Restangular) to the server to fetch a token plus derive a separate API url to use. Once the token is returned, it’s stored in localStorage and then passed to all subsequent API calls. Because I’m not […]

Is it bad security to save jwt in cookie to pass it to local storage?

In order to get my twitter sign in to work with jwt sessions and angularjs, I have created a jwt with twitter username and display name, passed it as a cookie and saved it to local storage. Here’s some relevant code: Log in users and save cookie: app.get(‘/login/twitter’, passport.authenticate(‘twitter’)); app.get(‘/login/twitter/callback’, function(req, res) { passport.authenticate(‘twitter’ , {session: false} , function(err, user, info) { if(err) { console.log(err); } var token; token = user.generateTwitterJwt(); // res.status(200); // res.json({ […]

Cors configuration not working spring boot + angular [duplicate]

This question already has an answer here: Response header is present in browser but not parsed by Angular $http response.headers() 2 answers i’m trying to get authentication token from header “autherntication” using angular, but when i use “console.log(response.headers()); i got only 1) cache-control 2) expires 3) pragma in dev tools there are all headers, i tried a log of filters but nothing working 🙁 , thanks for any help ! Fragment of Web configuration @Override […]