auth::token::redeem (public)

 auth::token::redeem -purpose purpose -token token -callback callback

Defined in packages/acs-authentication/tcl/token-procs.tcl

Redeem a token for the expected purpose. The callback is a trusted command prefix. It receives the user ID and stored context as its final arguments and runs in the token transaction. It must enforce the operation's authorization rules. A normal return consumes the token. An error rolls back the operation and leaves the token available to retry until expiry. External side effects belong after commit.

Switches:
-purpose (required)
-token (required)
-callback (required)
Returns:
A dictionary with status invalid, or status redeemed and the callback result.

Partial Call Graph (max 5 caller/called nodes):
auth::token::lock_account auth::token::lock_account (private) db_0or1row db_0or1row (public) db_dml db_dml (public) db_string db_string (public) db_transaction db_transaction (public) auth::token::redeem auth::token::redeem auth::token::redeem->auth::token::lock_account auth::token::redeem->db_0or1row auth::token::redeem->db_dml auth::token::redeem->db_string auth::token::redeem->db_transaction

Testcases:
No testcase defined.
[ show source ]
Show another procedure: