Interface Tm1Authenticator
- All Known Implementing Classes:
Tm1Authenticator.Described, Tm1Authenticator.Fixed
Authorization
header of a login request.
It's asked once per login, not once per session: a session logs in again when TM1 reports it expired, and credentials that expire themselves (a CAM passport) can be fresh each time. Only the login carries credentials; every other request carries the session cookie.
// TM1's own security
Tm1Authenticator basic = Tm1Authenticator.basic("admin", "apple");
// CAM, with a user and password
Tm1Authenticator cam = Tm1Authenticator.camNamespace("alice", "secret", "LDAP");
// CAM, with a passport
Tm1Authenticator passport = Tm1Authenticator.camPassport(passports);
// A passport from Cognos
Tm1Authenticator cognos = Tm1Authenticator.cognosLogon("http://cognos:9300", "LDAP", "alice", "secret");
Implementations must not log or otherwise reveal the credentials; describe()
is what logs show.
A Tm1SessionPool keeps one session for each set of a user's own credentials,
and tells them apart with equals. The authenticators here that hold their
credentials (basic(String, String), camNamespace(String, String, String), camPassport(String),
cognosLogon(String, String, String, String)) are equal when the credentials are. One that asks a supplier
(camPassport(Supplier), cognosIdToken(String, String, Supplier)) is only equal to itself, so
keep it and pass the same one each time; so is your own, unless it defines
equals.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classAnother authenticator under its own description: the ones that ask Cognos.static final classCredentials that don't change: Basic and CAMNamespace. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<String> TheAuthorizationheader value for one login, such asBasic YWRtaW46YXBwbGU=.static Tm1AuthenticatorBasic authentication, for TM1's own security (modes 1 and 2).static Tm1AuthenticatorcamNamespace(String user, String password, String namespace) Cognos Access Manager security with a user name and password in a CAM namespace (TM1 security mode 5):CAMNamespace base64(user:password:namespace).static Tm1AuthenticatorcamPassport(String passport) Cognos Access Manager security with one CAM passport the application already holds, such as the one a signed-in user's request carries:CAMPassport <passport>.static Tm1AuthenticatorcamPassport(Supplier<reactor.core.publisher.Mono<String>> passport) Cognos Access Manager security with a CAM passport, such as one obtained by exchanging an OIDC token with Cognos:CAMPassport <passport>.static Tm1AuthenticatorcognosIdToken(String dispatcher, String namespace, Supplier<reactor.core.publisher.Mono<String>> idToken) CAM security with a passport the client gets from Cognos for an OpenID Connect ID token it already holds (CognosPassports.idToken(String, String, Supplier)): a fresh passport for each login.static Tm1AuthenticatorcognosLogon(String dispatcher, String namespace, String user, String password) CAM security with a passport the client gets from Cognos itself, logging on with a user name and password (CognosPassports.password(String, String, String, String)): a fresh passport for each login.describe()What these credentials are, for logs, without any secret, such asBasic admin.
-
Method Details
-
authorization
reactor.core.publisher.Mono<String> authorization()TheAuthorizationheader value for one login, such asBasic YWRtaW46YXBwbGU=. An error fails that login and reaches the caller unchanged.- Returns:
- the header value
-
describe
String describe()What these credentials are, for logs, without any secret, such asBasic admin.- Returns:
- the description
-
basic
Basic authentication, for TM1's own security (modes 1 and 2).- Parameters:
user- the TM1 user namepassword- the password, ornullfor none- Returns:
- the authenticator
-
camNamespace
Cognos Access Manager security with a user name and password in a CAM namespace (TM1 security mode 5):CAMNamespace base64(user:password:namespace).- Parameters:
user- the user name in the namespacepassword- the passwordnamespace- the CAM namespace ID, such asLDAP- Returns:
- the authenticator
-
camPassport
Cognos Access Manager security with one CAM passport the application already holds, such as the one a signed-in user's request carries:CAMPassport <passport>. The passport isn't renewed: once it expires, a login with it is refused. Two of these are equal when their passports are, so aTm1SessionPoolgives a user's renewed passport a session of its own.- Parameters:
passport- the passport- Returns:
- the authenticator
-
camPassport
Cognos Access Manager security with a CAM passport, such as one obtained by exchanging an OIDC token with Cognos:CAMPassport <passport>. Passports expire, sopassportis asked for a current one on every login. When TM1 refuses a passport the login fails withTm1ErrorKind.CREDENTIAL_REJECTED, and the session doesn't keep trying.- Parameters:
passport- supplies a current passport; called once per login- Returns:
- the authenticator
-
cognosLogon
static Tm1Authenticator cognosLogon(String dispatcher, String namespace, String user, String password) CAM security with a passport the client gets from Cognos itself, logging on with a user name and password (CognosPassports.password(String, String, String, String)): a fresh passport for each login. UnlikecamNamespace(String, String, String), TM1 never sees the password, only Cognos does.- Parameters:
dispatcher- the Cognos dispatcher's address, such ashttp://cognos:9300namespace- the namespace's ID, such asLDAPuser- the user namepassword- the password- Returns:
- the authenticator
-
cognosIdToken
static Tm1Authenticator cognosIdToken(String dispatcher, String namespace, Supplier<reactor.core.publisher.Mono<String>> idToken) CAM security with a passport the client gets from Cognos for an OpenID Connect ID token it already holds (CognosPassports.idToken(String, String, Supplier)): a fresh passport for each login.- Parameters:
dispatcher- the Cognos dispatcher's address, such ashttp://cognos:9300namespace- the OIDC namespace's ID, such asOIDCidToken- supplies a current ID token; asked at each login- Returns:
- the authenticator
-