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.

How to set X-Auth-Token header ?

See original GitHub issue

Hello,

My Rest server needs an X-Auth-Token header to authorize the file sending. How do i set it on ng-flow ? This works:

    flowFactoryProvider.defaults = {
        target : 'http://localhost:8080/imageUpload',
        permanentErrors : [ 404, 500, 501 ],
        singleFile : true,
        headers: {'X-Auth-Token' : 'user:1407172832672:a334564e7dd50848bc20f8984a152f77'}
    };

But i can’t leave the token hard coded of course, i need to get it from “$rootScope.authToken” and set it to $flow from my controller. Thanks

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
jdc18commented, Apr 21, 2016

Example of my controller

rutas.controller("MisImagenesController", function($scope,$http, initService, keycloakLauncher){
        $scope.min = 0;
        $scope.resultados = 10;
        $scope.misArchivos = {};

        $scope.flowOptions = {
            target : 'https://localhost:8443/unika/upload',
            permanentErrors : [ 500, 501 ],
            maxChunkRetries : 1,
            chunkRetryInterval : 5000,
            simultaneousUploads : 4,
            progressCallbacksInterval : 1,
            withCredentials : true,
            method : 'octet',
            headers : {Authorization : 'Bearer ' + keycloak.token}
        };

… on my html <div flow-init="flowOptions">

1reaction
jdc18commented, Jun 25, 2015

Hey guys i figured a way around the problem with the help many others, and it works. Comment any configuration you had on the provider, or delete it,(flowFactoryProvider.defaults =…) . Then create a $scope variable, something like $scope.flowOptions, and on your flow-init set it like flow-init=“flowOptions”. I just finished the first test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When looking at the differences between X-Auth-Token vs ...
In case of 'x-auth-token' user has to supply username/password for the first time and server returns a access-token in header field 'x-auth-token'. For...
Read more >
Deprecate header "X-Auth-Token" by using "Authorization"
The header X-Auth-Token is designed to authenticate request that doesn't contain secure cookie. e.g., API requests from notebook.
Read more >
X-Authorization in headers for API interface - PHP - SitePoint
headers : X-Authorization: TOKEN TOKEN Where TOKEN is the token. The bareword “TOKEN” shown in the previous line must be included.
Read more >
The XAuth Protocol - IETF
Client software often desires resources or identity claims that are managed independent of the client. This protocol allows a user and/or ...
Read more >
Authorization and Headers - Yahoo Developer Network
This article describes authentication and authorization configurations required to ... See DSP Authentication guide for setup instructions. ... X-Auth-Token.
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