Tm1Authenticator
using Skipcheck.Tm1.Client.Auth; Supplies the credentials for logging in to TM1: the value of the 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
var basic = Tm1Authenticator.Basic("admin", "apple");
// CAM, with a user and password
var cam = Tm1Authenticator.CamNamespace("alice", "secret", "LDAP");
// CAM, with a passport
var passport = Tm1Authenticator.CamPassport(passports);
// A passport from Cognos
var 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, CamNamespace, CamPassport,
CognosLogon) are equal when the credentials are. One that asks a supplier
(CamPassport, CognosIdToken) is only equal to itself, so
keep it and pass the same one each time; so is your own, unless it defines
Equals.
Members
AuthorizationAsync | The header to log in with; asked for at each login. |
Describe | Who logs in, without secrets, for logs and errors. |
ToString | |
Basic static | TM1's own security (modes 1 and 2). |
CamNamespace static | CAM security (modes 4 and 5), with a user in a namespace. |
CamPassport static | CAM security with one CAM passport the application already holds, such as the one a signed-in user's request carries. |
CamPassport static | CAM security with a passport, fetched at each login (a passport expires). |
CognosLogon static | CAM security with a passport the client gets from Cognos itself, logging on with a user name and password (CognosPassports.Password). |
CognosIdToken static | CAM security with a passport the client gets from Cognos for an OpenID Connect ID token it already holds (CognosPassports.IdToken). |
AuthorizationAsync
ValueTask<string> AuthorizationAsync(CancellationToken cancellationToken = default)The header to log in with; asked for at each login.
Describe
string Describe()Who logs in, without secrets, for logs and errors.
ToString
string ToString()Basic
staticTm1Authenticator Basic(string user, string? password)TM1's own security (modes 1 and 2).
CamNamespace
staticTm1Authenticator CamNamespace(string user, string password, string @namespace)CAM security (modes 4 and 5), with a user in a namespace.
CamPassport
staticTm1Authenticator CamPassport(string passport)CAM 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 a Tm1SessionPool gives a user's renewed passport a session of its own.
CamPassport
staticTm1Authenticator CamPassport(Func<CancellationToken, ValueTask<string>> passport)CAM security with a passport, fetched at each login (a passport expires).
CognosLogon
staticTm1Authenticator CognosLogon( string dispatcher, string @namespace, string user, string password, System.Net.Http.HttpMessageHandler? handler = null )CAM security with a passport the client gets from Cognos itself, logging on with a
user name and password (CognosPassports.Password): a fresh passport for each
login. Unlike CamNamespace, TM1 never sees the password, only Cognos does.
Parameters
dispatcher- The Cognos dispatcher's address, such as
http://cognos:9300. user- The user name.
password- The password.
CognosIdToken
staticTm1Authenticator CognosIdToken( string dispatcher, string @namespace, Func<CancellationToken, ValueTask<string>> idToken, System.Net.Http.HttpMessageHandler? handler = null )CAM security with a passport the client gets from Cognos for an OpenID Connect ID
token it already holds (CognosPassports.IdToken): a fresh passport for each login.
Parameters
dispatcher- The Cognos dispatcher's address, such as
http://cognos:9300. idToken- Supplies a current ID token; asked at each login.