Using the STM API involves
- using ato_stm_create() to create one or more STS service objects, based on a template used to construct requests, and which represents
- the STS end-point (URL) from which to request SecurityTokens.
- using ato_stm_stsissue to request SecurityTokens
- using the STM TKN API to query the SecurityToken
Create an STM object
ato_CfgMgr *ctxmgr = NULL;
:
:
struct _ato_Stm ato_Stm
The STM object used to interact with an STS service to retrieve Security Tokens (ato_StmTkn).
Definition: include/atostm/stm.h:12
ATO_STM_EXPORT int ato_stm_create(ato_Ctx *ctx, ato_Stm **stm, const char *stsurl, const char *stmtemplate)
Create an STM object from the XML stored in stmtemplate.
struct _ato_StmTkn ato_StmTkn
The Security Token object.
Definition: stmtkn.h:12
The parameters are:
- context
- address of the STM object to allocate
- the endpoint URL - if NULL then load from the configuration
- the buffer containing the XML string for the template - if NULL then load from the file specified in the configuration
- Note
- The stm object must be freed when finished with.
Get a SecurityToken
:
:
ATO_STM_EXPORT int ato_stm_stsissue(ato_Ctx *ctx, ato_Stm *stm, ato_StmTkn **st, ato_String *certificate, ato_String *privatekey, const char *relyingpartyurl)
Submit an STS issue request to the STS service and return a SecurityToken response object.
The parameters are:
- the STM object
- the address of the SecurityToken object to create
- the X509 certificate to use for the request
- the privatekey corresponding to the X509Certificate
- the relying party URL to use in subsequent WebServices transactions (e.g. SBRCSR); if NULL get the value from the configuration
- Note
- The SecurityToken object is a const which is freed when the STM object is freed.
Retrieve values from the SecurityToken
struct _ato_String ato_String
ATO_STM_EXPORT ato_String * ato_stmtkn_assertion(ato_StmTkn *st)
Given a SecurityToken object, retrieve the encrypted assertion.
ATO_STM_EXPORT ato_String * ato_stmtkn_prooftoken(ato_StmTkn *st)
Given a SecurityToken object, retrieve the embedded proof token.
Cleanup
ATO_STM_EXPORT void ato_stm_free(ato_Ctx *ctx, ato_Stm *stm)
Free the STM object.