[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1524
  • Last Modified:

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
0
JElster
Asked:
JElster
  • 5
  • 2
1 Solution
 
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
 
Kyle HamiltonData ScientistCommented:
nope. been there done that.

it's too late. browser handles it before js
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
 
Kyle HamiltonData 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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now