CognosPassports
from skipcheck_tm1.cognos import CognosPassports CAM passports from Cognos, for Authenticator.cam_passport: 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
Tm1AuthenticationError
(Tm1ErrorKind.CREDENTIAL_REJECTED), 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
cognos = auth.cognos_logon("https://cognos.example.com:9300", "LDAP", "alice", password)
return Tm1Client.builder().address("https://tm1.example.com:8010").authenticator(cognos).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
cognos = auth.cognos_id_token("https://cognos.example.com:9300", "OIDC", current_id_token)
return Tm1Client.builder().address("https://tm1.example.com:8010").authenticator(cognos).build()
Members
password static | By user name and password (CAMUsername, CAMPassword). |
id_token static | By an OpenID Connect ID token (CAMOIDCIdToken) the caller already holds; asked for at each logon. |
password
staticpassword(dispatcher: str, namespace: str, user: str, password: str, *, http_client: Callable[[], Any] | None = None) -> Callable[[], Awaitable[str]]By user name and password (CAMUsername, CAMPassword). http_client makes the HTTP client to reach Cognos with (for TLS settings, proxies, tests).
id_token
staticid_token(dispatcher: str, namespace: str, id_token: Callable[[], Any], *, http_client: Callable[[], Any] | None = None) -> Callable[[], Awaitable[str]]By an OpenID Connect ID token (CAMOIDCIdToken) the caller already holds; asked for at each logon.