1

We are trying to enable a custom credential handling layer to our ActivePivot tomcat servlet by intercepting incoming requests to the Cube and authenticating them as needed using a Spring Security Filter. Our system provides an "API Key" to logged in users if the username and password are valid and we would like some way of getting Excel to use this key once it has been logged in using HTTP Basic AUthentication.

When entering login credentials into the Excel "Data Connection Wizard" to connect to the AP Cube, it goes through the normal procedure of doing a GET on a Cube URL, where we return a 401 (since no API Key is present in the headers) with a "WWW-Authenticate: Basic Realm=..." header, to which it responds by getting the same URL with an "Authenticate: Basic ..." header with which we perform a username/password login and get an API key and actually return the contents for the request. This is all good and working as expected.

The question is, can we get Excel to remember that it has successfully authenticated and just pass the API Key in the "Authenticate" header in future requests? So far I have tried to send the API Key back in an "Authenticate" header in the response but Excel doesn't seem to notice that. Is there a standard way to pass a 'login token' for basic auth to the client?

This would solve 2 problems on our end: 1) we don't have to do a login every time a request is made and 2) we don't get double the number of requests (GET -> 401 -> GET with Auth -> return) since Excel would know it has already authenticated.

Burton Samograd
  • 3,652
  • 19
  • 21

2 Answers2

0

can you have a look at PRE_AUTH_FILTER from spring security: http://static.springsource.org/spring-security/site/docs/3.1.x/reference/preauth.html Regards,

tuxmobil
  • 238
  • 3
  • 10
0

According to this article it looks like what I want might be impossible without hacking up a redirect of some sort:

http://www.vc2go.com/2009/11/cookie-based-authentication-does-not-work-with-excel.html

Problem: Some security expert (I assume) at one of the largest IT companies in the world, figured out that sending cookies on web-requests from Excel is a bad thing. E.g. when you select a URL link in Excel, the resulting request in IE will never send any cookies. The request will open up in Internet Explorer fine, but it sucks that the users have to log onto our system for each row they access.

If you based authentication on sessions or cookies, you are basically stuck.

Community
  • 1
  • 1
Burton Samograd
  • 3,652
  • 19
  • 21