Interface EssAuthentication
- All Known Implementing Classes:
BasicAuthentication,BearerTokenAuthentication,SessionAuthentication,SessionCookieAuthentication
Essbase's REST API accepts more than one answer to that question. A username and password over HTTP Basic
is the obvious one, but the API also honours a plain session - once a request has been authenticated, the
JSESSIONID and _WL_AUTHCOOKIE_JSESSIONID cookies it returns are sufficient on their own,
with no Authorization header at all (verified against Essbase 21.7). That matters well beyond
tidiness: a deployment fronted by an external identity provider may have no password this API can check,
because a federated user's credentials live at the identity provider and never reach Essbase. Being able
to present a session that was established some other way is the difference between supporting such a
deployment and not.
Implementations may be consulted from several threads, since one client is shared, and must be safe for that.
-
Method Summary
Modifier and TypeMethodDescriptionThe value for theAuthorizationheader, or null to send none.static EssAuthenticationUsername and password on every request, with no session.static EssAuthenticationbearerToken(String token) A bearer token, sent asAuthorization: Bearer <token>.default StringThe value for theCookieheader, or null to send none.default voidobserveSetCookies(List<String> setCookieHeaders) Offers theSet-Cookieheaders from a response, so an implementation that establishes a session as it goes can pick one up.static EssAuthenticationUsername and password until the server returns a session, then the session thereafter.static EssAuthenticationsessionCookie(String sessionId, String weblogicAuthCookie) An existing session, presented as cookies, with no username or password anywhere.default voidTold that the session this was using has been ended server-side, so that any session state held here is discarded rather than being presented again after it has stopped being valid.When the current session expires, if that is known.username()The user being authenticated as, where this strategy knows it.
-
Method Details
-
authorizationHeader
String authorizationHeader()The value for theAuthorizationheader, or null to send none. Null is meaningful rather than a degenerate case - a cookie-borne session needs noAuthorizationheader. -
cookieHeader
The value for theCookieheader, or null to send none. -
observeSetCookies
Offers theSet-Cookieheaders from a response, so an implementation that establishes a session as it goes can pick one up. Called for every response; most implementations ignore it.Takes the raw header values rather than the response so that the decision this makes - which is the subtle part - can be tested without a server or an
HttpResponse.- Parameters:
setCookieHeaders- everySet-Cookieheader value on the response, possibly empty
-
username
The user being authenticated as, where this strategy knows it.Empty for a strategy that only carries a session or a token: those identify a user to the server without the client necessarily knowing who it is. A caller that needs the name regardless has to ask the server - but should prefer this, because asking is a round trip and, on Essbase 26.1,
GET /sessionanswers 500. -
sessionEnded
default void sessionEnded()Told that the session this was using has been ended server-side, so that any session state held here is discarded rather than being presented again after it has stopped being valid.What that leaves behind depends on the strategy. One holding a username and password falls back to them and will establish a fresh session on the next call; one that only ever had a session has nothing to fall back to, and subsequent calls will be rejected - correctly, because signing off is exactly what the caller asked for.
-
sessionExpiry
When the current session expires, if that is known. Essbase reports it in asessionExpirycookie alongside the session itself, so it is only ever known for a session this library established. -
basic
Username and password on every request, with no session. Corresponds to what this library has always called "stateless". -
session
Username and password until the server returns a session, then the session thereafter. The default, and what this library has always done in its normal (non-stateless) mode. -
sessionCookie
An existing session, presented as cookies, with no username or password anywhere.For a session established outside this library - most obviously by a user signing in through an external identity provider, where there is no password for Essbase to check.
- Parameters:
sessionId- theJSESSIONIDvalueweblogicAuthCookie- the_WL_AUTHCOOKIE_JSESSIONIDvalue, or null if there isn't one
-
bearerToken
A bearer token, sent asAuthorization: Bearer <token>.Provided for deployments whose REST endpoint accepts an OAuth token from an identity provider. Whether a given Essbase accepts one is a property of that deployment: an on-premises 21.7 instance rejects bearer tokens outright, while an Oracle Analytics Cloud instance fronted by IDCS may not. Test against the server in question before relying on it.
-