AngularJS $HTTP returns 302

Hi.. I have AngularJS call

   var responsePromise = $http.get(url);

It returns a 302  Redirect to Oracle SSO for login.

How do I handle and process the redirect?

any ideas?

thx
LVL 1
JElsterAsked:
Who is Participating?
 
Kyle HamiltonConnect With a Mentor Data ScientistCommented:
yes, you will need to provide the token. you can either attach it to every request, or have a middle layer that does it for you with every request
0
 
Kyle HamiltonData ScientistCommented:
there is nothing you can do with a 302. the browser catches it and handles it before javascript can get to it. you can't even capture the location from the headers. you have to deal with it server side, or in the application that does the redirect.
0
 
JElsterAuthor Commented:
What about using an Angular interceptor?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
Kyle HamiltonData ScientistCommented:
nope. been there done that.

it's too late. browser handles it before js
0
 
JElsterAuthor Commented:
So how can you make an HTTP call that uses SSO?  needs I guess, the token
0
 
Kyle HamiltonData ScientistCommented:
btw, if you dont have control over the server or the application doing the redirect, it's not unusual to process a login outside of angular. i dont know the details of your environment so obviously can't help much in that regard
0
 
Kyle HamiltonData ScientistCommented:
sorry you beat me to the post
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.