CognosPassports
using Skipcheck.Tm1.Client.Auth; CAM passports from Cognos, for Tm1Authenticator.CamPassport: the client logs on
to Cognos itself, rather than being handed a passport. Each supplier logs on again
every time it's asked, so every TM1 login (including the one after TM1 drops a session)
gets a fresh passport, and an expired one is never reused.
Both log on with Cognos's REST API: PUT <dispatcher>/api/v1/session with the
logon parameters, answered with the passport in a cam_passport cookie. The
dispatcher is the address TM1 itself is pointed at (ServerCAMURI, such as
http://cognos:9300), reachable from the client; TM1 names it when it refuses a
login (WWW-Authenticate: CAMPassport http://cognos:9300/bi/v1/disp).
A logon Cognos refuses fails with a
Tm1AuthenticationException
(Tm1ErrorKind.CredentialRejected), which the session doesn't retry.
Log on with a user name and password, for a passport each login:
// The client logs on to Cognos for a passport at every TM1 login, so TM1 never
// sees the password and an expired passport is never reused
return Tm1Client
.Builder()
.Address("https://tm1.example.com:8010")
.Authenticator(Tm1Authenticator.CognosLogon("https://cognos.example.com:9300", "LDAP", "alice", password))
.Build();
Exchange the ID token of a user the application signed in with OpenID Connect:
// An application that signed its user in with OpenID Connect hands over their ID
// token; Cognos's OIDC namespace turns it into a passport
return Tm1Client
.Builder()
.Address("https://tm1.example.com:8010")
.Authenticator(Tm1Authenticator.CognosIdToken("https://cognos.example.com:9300", "OIDC", currentIdToken))
.Build();
Members
Password static | Passports for a user name and password in a namespace, such as an LDAP one (CAMNamespace, CAMUsername, CAMPassword). |
IdToken static | Passports for an OpenID Connect ID token the application already holds, through Cognos's OIDC namespace (CAMNamespace, CAMOIDCIdToken). |
Password
staticFunc<CancellationToken, ValueTask<string>> Password( string dispatcher, string @namespace, string user, string password, HttpMessageHandler? handler = null )Passports for a user name and password in a namespace, such as an LDAP one
(CAMNamespace, CAMUsername, CAMPassword).
Parameters
dispatcher- The Cognos dispatcher's address, such as
http://cognos:9300. user- The user name.
password- The password.
Returns
- A function that logs on each time it's called.
IdToken
staticFunc<CancellationToken, ValueTask<string>> IdToken( string dispatcher, string @namespace, Func<CancellationToken, ValueTask<string>> idToken, HttpMessageHandler? handler = null )Passports for an OpenID Connect ID token the application already holds, through
Cognos's OIDC namespace (CAMNamespace, CAMOIDCIdToken): no password ever reaches
the client.
Parameters
dispatcher- The Cognos dispatcher's address, such as
http://cognos:9300. idToken- Supplies a current ID token; asked at each logon.
Returns
- A function that logs on each time it's called.