Class SessionAuthentication
- All Implemented Interfaces:
EssAuthentication
This is what the library has always done outside "stateless" mode, and it is worth keeping rather than always sending Basic: Essbase creates a server-side session per authenticated request, so re-presenting the password on every call leaves a trail of sessions behind.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe value for theAuthorizationheader, or null to send none.The value for theCookieheader, or null to send none.The session this has established, or null if it is still authenticating with a password.The WebLogic authentication cookie for the established session, or null.voidobserveSetCookies(List<String> setCookieHeaders) Offers theSet-Cookieheaders from a response, so an implementation that establishes a session as it goes can pick one up.voidForgets the session, falling back to the username and password.When the current session expires, if that is known.username()The user being authenticated as, where this strategy knows it.
-
Constructor Details
-
SessionAuthentication
-
-
Method Details
-
username
Description copied from interface:EssAuthenticationThe 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.- Specified by:
usernamein interfaceEssAuthentication
-
authorizationHeader
Description copied from interface:EssAuthenticationThe value for theAuthorizationheader, or null to send none. Null is meaningful rather than a degenerate case - a cookie-borne session needs noAuthorizationheader.- Specified by:
authorizationHeaderin interfaceEssAuthentication
-
cookieHeader
Description copied from interface:EssAuthenticationThe value for theCookieheader, or null to send none.- Specified by:
cookieHeaderin interfaceEssAuthentication
-
observeSetCookies
Description copied from interface:EssAuthenticationOffers 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.- Specified by:
observeSetCookiesin interfaceEssAuthentication- Parameters:
setCookieHeaders- everySet-Cookieheader value on the response, possibly empty
-
sessionExpiry
Description copied from interface:EssAuthenticationWhen 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.- Specified by:
sessionExpiryin interfaceEssAuthentication
-
sessionEnded
public void sessionEnded()Forgets the session, falling back to the username and password. The next request authenticates with them and the server issues a fresh session, so signing off and carrying on works rather than leaving the client wedged presenting a session the server has already discarded.- Specified by:
sessionEndedin interfaceEssAuthentication
-
getSessionId
The session this has established, or null if it is still authenticating with a password. -
getWeblogicAuthCookie
The WebLogic authentication cookie for the established session, or null.Exposed alongside
getSessionId()so a session established here can be handed toEssAuthentication.sessionCookie(java.lang.String, java.lang.String)- the same handoff a caller performs when the session came from somewhere else entirely, such as a browser sign-in.
-