Iddawc
Handle the flow of OAuth2 and OpenID Connect authentication process from the client side.
|
Functions | |
int | i_set_response_type (struct _i_session *i_session, unsigned int i_value) |
int | i_set_result (struct _i_session *i_session, unsigned int i_value) |
int | i_set_int_parameter (struct _i_session *i_session, i_option option, unsigned int i_value) |
int | i_set_str_parameter (struct _i_session *i_session, i_option option, const char *s_value) |
int | i_set_additional_parameter (struct _i_session *i_session, const char *s_key, const char *s_value) |
int | i_set_additional_response (struct _i_session *i_session, const char *s_key, const char *s_value) |
int | i_add_claim_request (struct _i_session *i_session, int target, const char *claim, int essential, const char *value) |
int | i_remove_claim_request (struct _i_session *i_session, int target, const char *claim) |
int | i_set_rich_authorization_request_json_t (struct _i_session *i_session, const char *type, json_t *j_value) |
int | i_set_rich_authorization_request_str (struct _i_session *i_session, const char *type, const char *value) |
int | i_remove_rich_authorization_request (struct _i_session *i_session, const char *type) |
json_t * | i_get_rich_authorization_request_json_t (struct _i_session *i_session, const char *type) |
char * | i_get_rich_authorization_request_str (struct _i_session *i_session, const char *type) |
unsigned int | i_get_response_type (struct _i_session *i_session) |
unsigned int | i_get_result (struct _i_session *i_session) |
unsigned int | i_get_int_parameter (struct _i_session *i_session, i_option option) |
const char * | i_get_str_parameter (struct _i_session *i_session, i_option option) |
const char * | i_get_additional_parameter (struct _i_session *i_session, const char *s_key) |
const char * | i_get_additional_response (struct _i_session *i_session, const char *s_key) |
json_t * | i_get_server_configuration (struct _i_session *i_session) |
int | i_set_server_configuration (struct _i_session *i_session, json_t *j_openid_config) |
json_t * | i_get_server_jwks (struct _i_session *i_session) |
int | i_set_server_jwks (struct _i_session *i_session, json_t *j_jwks) |
json_t * | i_get_client_jwks (struct _i_session *i_session) |
int | i_set_client_jwks (struct _i_session *i_session, json_t *j_jwks) |
int | i_set_parameter_list (struct _i_session *i_session,...) |
json_t * | i_export_session_json_t (struct _i_session *i_session) |
int | i_import_session_json_t (struct _i_session *i_session, json_t *j_import) |
char * | i_export_session_str (struct _i_session *i_session) |
int | i_import_session_str (struct _i_session *i_session, const char *str_import) |
int | i_import_session_from_registration (struct _i_session *i_session, json_t *j_registration) |
Manipulates inner data of the session
int i_add_claim_request | ( | struct _i_session * | i_session, |
int | target, | ||
const char * | claim, | ||
int | essential, | ||
const char * | value | ||
) |
Adds a claim to the request
i_session | a reference to a struct _i_session * |
target | where the claim should be returned, values available are I_CLAIM_TARGET_ALL, I_CLAIM_TARGET_USERINFO or I_CLAIM_TARGET_ID_TOKEN |
claim | the name of the claim |
essential | is the claim essential value set or null values available are I_CLAIM_ESSENTIAL_NULL, I_CLAIM_ESSENTIAL_TRUE, I_CLAIM_ESSENTIAL_FALSE or I_CLAIM_ESSENTIAL_IGNORE |
value | will override essential parameter if set, sets the claim value with the content of the value parsed in JSON |
json_t* i_export_session_json_t | ( | struct _i_session * | i_session | ) |
Exports a _i_session * into a json_t * object
i_session | a reference to a struct _i_session * |
char* i_export_session_str | ( | struct _i_session * | i_session | ) |
Exports a _i_session * into a json_t * object
i_session | a reference to a struct _i_session * |
const char* i_get_additional_parameter | ( | struct _i_session * | i_session, |
const char * | s_key | ||
) |
Gets an additional parameter for auth or token requests
i_session | a reference to a struct _i_session * |
s_key | the key to get |
const char* i_get_additional_response | ( | struct _i_session * | i_session, |
const char * | s_key | ||
) |
Gets an additional response from auth or token requests
i_session | a reference to a struct _i_session * |
s_key | the key to get |
json_t* i_get_client_jwks | ( | struct _i_session * | i_session | ) |
Gets the client configuration
i_session | a reference to a struct _i_session * |
unsigned int i_get_int_parameter | ( | struct _i_session * | i_session, |
i_option | option | ||
) |
Returns the integer value of an option
i_session | a reference to a struct _i_session * |
option | the option to get options availble are I_OPT_RESULT, I_OPT_AUTH_METHOD, I_OPT_TOKEN_METHOD, I_OPT_EXPIRES_IN, I_OPT_EXPIRES_AT, I_OPT_STATE_GENERATE, I_OPT_NONCE_GENERATE, I_OPT_X5U_FLAGS, I_OPT_OPENID_CONFIG_STRICT, I_OPT_TOKEN_JTI_GENERATE, I_OPT_TOKEN_EXP, I_OPT_DEVICE_AUTH_EXPIRES_IN, I_OPT_DEVICE_AUTH_INTERVAL, I_OPT_PUSHED_AUTH_REQ_REQUIRED, I_OPT_PUSHED_AUTH_REQ_EXPIRES_IN, I_OPT_USE_DPOP, I_OPT_DECRYPT_CODE, I_OPT_DECRYPT_REFRESH_TOKEN, I_OPT_DECRYPT_ACCESS_TOKEN, I_OPT_REMOTE_CERT_FLAG, I_OPT_PKCE_CODE_VERIFIER_GENERATE, I_OPT_PKCE_METHOD |
unsigned int i_get_response_type | ( | struct _i_session * | i_session | ) |
Returns the response type of the current session
i_session | a reference to a struct _i_session * |
unsigned int i_get_result | ( | struct _i_session * | i_session | ) |
Returns the result of the last oauth2 request
i_session | a reference to a struct _i_session * |
json_t* i_get_rich_authorization_request_json_t | ( | struct _i_session * | i_session, |
const char * | type | ||
) |
Returns an authorization request object based on the type
i_session | a reference to a struct _i_session * |
type | the type of the authorization request |
char* i_get_rich_authorization_request_str | ( | struct _i_session * | i_session, |
const char * | type | ||
) |
Returns an authorization request object based on the type
i_session | a reference to a struct _i_session * |
type | the type of the authorization request |
json_t* i_get_server_configuration | ( | struct _i_session * | i_session | ) |
Gets the server configuration
i_session | a reference to a struct _i_session * |
json_t* i_get_server_jwks | ( | struct _i_session * | i_session | ) |
Gets the server configuration
i_session | a reference to a struct _i_session * |
const char* i_get_str_parameter | ( | struct _i_session * | i_session, |
i_option | option | ||
) |
Returns the char * value of an option
i_session | a reference to a struct _i_session * |
option | the option to get options available are I_OPT_SCOPE, I_OPT_SCOPE_APPEND, I_OPT_STATE, I_OPT_NONCE, I_OPT_REDIRECT_URI, I_OPT_REDIRECT_TO, I_OPT_CLIENT_ID, I_OPT_CLIENT_SECRET, I_OPT_AUTH_ENDPOINT, I_OPT_TOKEN_ENDPOINT, I_OPT_OPENID_CONFIG_ENDPOINT, I_OPT_OPENID_CONFIG, I_OPT_USERINFO_ENDPOINT, I_OPT_ERROR, I_OPT_ERROR_DESCRIPTION, I_OPT_ERROR_URI, I_OPT_CODE, I_OPT_REFRESH_TOKEN, I_OPT_ACCESS_TOKEN, I_OPT_ID_TOKEN, I_OPT_TOKEN_TYPE, I_OPT_USERNAME, I_OPT_USER_PASSWORD, I_OPT_ISSUER, I_OPT_USERINFO, I_OPT_SERVER_KID, I_OPT_SERVER_ENC_ALG, I_OPT_SERVER_ENC, I_OPT_CLIENT_KID, I_OPT_CLIENT_SIGN_ALG, I_OPT_CLIENT_ENC_ALG, I_OPT_CLIENT_ENC, I_OPT_TOKEN_JTI, I_OPT_TOKEN_TARGET, I_OPT_TOKEN_TARGET_TYPE_HINT, I_OPT_REVOCATION_ENDPOINT, I_OPT_INTROSPECTION_ENDPOINT, I_OPT_REGISTRATION_ENDPOINT, I_OPT_DEVICE_AUTHORIZATION_ENDPOINT, I_OPT_DEVICE_AUTH_CODE, I_OPT_DEVICE_AUTH_USER_CODE, I_OPT_DEVICE_AUTH_VERIFICATION_URI, I_OPT_DEVICE_AUTH_VERIFICATION_URI_COMPLETE, I_OPT_END_SESSION_ENDPOINT, I_OPT_CHECK_SESSION_IRAME, I_OPT_PUSHED_AUTH_REQ_ENDPOINT, I_OPT_PUSHED_AUTH_REQ_URI, I_OPT_DPOP_KID, I_OPT_DPOP_SIGN_ALG, I_OPT_TLS_KEY_FILE, I_OPT_TLS_CERT_FILE, I_OPT_PKCE_CODE_VERIFIER, I_OPT_RESOURCE_INDICATOR, I_OPT_ACCESS_TOKEN_SIGNING_ALG, I_OPT_ACCESS_TOKEN_ENCRYPTION_ALG, I_OPT_ACCESS_TOKEN_ENCRYPTION_ENC, I_OPT_ID_TOKEN_SIGNING_ALG, I_OPT_ID_TOKEN_ENCRYPTION_ALG, I_OPT_ID_TOKEN_ENCRYPTION_ENC, I_OPT_USERINFO_SIGNING_ALG, I_OPT_USERINFO_ENCRYPTION_ALG, I_OPT_USERINFO_ENCRYPTION_ENC, I_OPT_REQUEST_OBJECT_SIGNING_ALG, I_OPT_REQUEST_OBJECT_ENCRYPTION_ALG, I_OPT_REQUEST_OBJECT_ENCRYPTION_ENC, I_OPT_TOKEN_ENDPOINT_SIGNING_ALG, I_OPT_TOKEN_ENDPOINT_ENCRYPTION_ALG, I_OPT_TOKEN_ENDPOINT_ENCRYPTION_ENC, I_OPT_CIBA_REQUEST_SIGNING_ALG, I_OPT_CIBA_REQUEST_ENCRYPTION_ALG, I_OPT_CIBA_REQUEST_ENCRYPTION_ENC, I_OPT_AUTH_RESPONSE_SIGNING_ALG, I_OPT_AUTH_RESPONSE_ENCRYPTION_ALG, I_OPT_AUTH_RESPONSE_ENCRYPTION_ENC, I_OPT_CIBA_ENDPOINT, I_OPT_CIBA_USER_CODE, I_OPT_CIBA_LOGIN_HINT, I_OPT_CIBA_LOGIN_HINT_KID, I_OPT_CIBA_BINDING_MESSAGE, I_OPT_CIBA_CLIENT_NOTIFICATION_TOKEN, I_OPT_CIBA_AUTH_REQ_ID, I_OPT_CIBA_CLIENT_NOTIFICATION_ENDPOINT, I_OPT_FRONTCHANNEL_LOGOUT_URI, I_OPT_BACKCHANNEL_LOGOUT_URI, I_OPT_POST_LOGOUT_REDIRECT_URI, I_OPT_ID_TOKEN_SID, I_OPT_DPOP_NONCE_AS, I_OPT_DPOP_NONCE_RS, I_OPT_HTTP_PROXY |
int i_import_session_from_registration | ( | struct _i_session * | i_session, |
json_t * | j_registration | ||
) |
Imports a _i_session * from a registration result Imported data will overwrite existing data in i_session The redirect_uri selected will be the first one from the redirect_uris array
i_session | a reference to a struct _i_session * |
j_registration | a json_t * object containing the registration result from the AS |
int i_import_session_json_t | ( | struct _i_session * | i_session, |
json_t * | j_import | ||
) |
Imports a _i_session * from a json_t * object Imported data will overwrite existing data in i_session
i_session | a reference to a struct _i_session * |
j_import | a json_t * object in i_export_session_json_t format |
int i_import_session_str | ( | struct _i_session * | i_session, |
const char * | str_import | ||
) |
Imports a _i_session * from a json_t * object Imported data will overwrite existing data in i_session
i_session | a reference to a struct _i_session * |
str_import | a char * containing a JSON stringified session |
int i_remove_claim_request | ( | struct _i_session * | i_session, |
int | target, | ||
const char * | claim | ||
) |
Removes a claim from the request
i_session | a reference to a struct _i_session * |
target | where the claim should be returned, values available are I_CLAIM_TARGET_ALL, I_CLAIM_TARGET_USERINFO or I_CLAIM_TARGET_ID_TOKEN |
claim | the name of the claim to remove |
int i_remove_rich_authorization_request | ( | struct _i_session * | i_session, |
const char * | type | ||
) |
Remove an authorization request object based on the type
i_session | a reference to a struct _i_session * |
type | the type of the authorization request |
int i_set_additional_parameter | ( | struct _i_session * | i_session, |
const char * | s_key, | ||
const char * | s_value | ||
) |
Sets an additional parameter for auth or token requests
i_session | a reference to a struct _i_session * |
s_key | the key to set |
s_value | the value to set |
int i_set_additional_response | ( | struct _i_session * | i_session, |
const char * | s_key, | ||
const char * | s_value | ||
) |
Sets an additional response value
i_session | a reference to a struct _i_session * |
s_key | the key to set |
s_value | the value to set |
int i_set_client_jwks | ( | struct _i_session * | i_session, |
json_t * | j_jwks | ||
) |
Sets the client configuration
i_session | a reference to a struct _i_session * |
j_jwks | the client public JWKS in json_t * format |
int i_set_int_parameter | ( | struct _i_session * | i_session, |
i_option | option, | ||
unsigned int | i_value | ||
) |
Sets an unsigned integer property value
i_session | a reference to a struct _i_session * |
option | the option to set options availble are I_OPT_RESULT, I_OPT_AUTH_METHOD, I_OPT_TOKEN_METHOD, I_OPT_EXPIRES_IN, I_OPT_EXPIRES_AT, I_OPT_STATE_GENERATE, I_OPT_NONCE_GENERATE, I_OPT_X5U_FLAGS, I_OPT_OPENID_CONFIG_STRICT, I_OPT_TOKEN_JTI_GENERATE, I_OPT_TOKEN_EXP, I_OPT_DEVICE_AUTH_EXPIRES_IN, I_OPT_DEVICE_AUTH_INTERVAL, I_OPT_PUSHED_AUTH_REQ_REQUIRED, I_OPT_PUSHED_AUTH_REQ_EXPIRES_IN, I_OPT_USE_DPOP, I_OPT_DECRYPT_CODE, I_OPT_DECRYPT_REFRESH_TOKEN, I_OPT_DECRYPT_ACCESS_TOKEN, I_OPT_REMOTE_CERT_FLAG, I_OPT_PKCE_CODE_VERIFIER_GENERATE, I_OPT_PKCE_METHOD, I_OPT_CIBA_MODE, I_OPT_CIBA_LOGIN_HINT_FORMAT, I_OPT_CIBA_CLIENT_NOTIFICATION_TOKEN_GENERATE, I_OPT_CIBA_AUTH_REQ_EXPIRES_IN, I_OPT_CIBA_AUTH_REQ_INTERVAL, I_OPT_FRONTCHANNEL_LOGOUT_SESSION_REQUIRED, I_OPT_BACKCHANNEL_LOGOUT_SESSION_REQUIRED, I_OPT_SERVER_JWKS_CACHE_EXPIRATION, I_OPT_SAVE_HTTP_REQUEST_RESPONSE |
i_value | The unsigned integer value to set |
int i_set_parameter_list | ( | struct _i_session * | i_session, |
... | |||
) |
Sets a list of parameters to a session
i_session | a reference to a struct _i_session * the list of parameters to set Uses a variable-length parameter list the syntax is the option followed by the value(s) required by the option The list must be ended by a I_OPT_NONE Example: i_set_parameter_list(i_session, I_OPT_RESPONSE_TYPE, I_RESPONSE_TYPE_CODE, I_OPT_SCOPE, "scope1", I_OPT_STATE, "abcd", I_OPT_CLIENT_ID, "client1", I_OPT_AUTH_ENDPOINT, "https://auth2.tld/auth", I_OPT_NONE); |
int i_set_response_type | ( | struct _i_session * | i_session, |
unsigned int | i_value | ||
) |
Sets response type of a session
i_session | a reference to a struct _i_session * |
i_value | the response type values available are I_RESPONSE_TYPE_NONE, I_RESPONSE_TYPE_CODE, I_RESPONSE_TYPE_TOKEN, I_RESPONSE_TYPE_ID_TOKEN, I_RESPONSE_TYPE_PASSWORD, I_RESPONSE_TYPE_CLIENT_CREDENTIALS, I_RESPONSE_TYPE_REFRESH_TOKEN and I_RESPONSE_TYPE_DEVICE_CODE Values I_RESPONSE_TYPE_CODE, I_RESPONSE_TYPE_TOKEN and I_RESPONSE_TYPE_ID_TOKEN can be stacked if using hybrid flow, example: I_RESPONSE_TYPE_CODE | I_RESPONSE_TYPE_TOKEN | I_RESPONSE_TYPE_ID_TOKEN |
int i_set_result | ( | struct _i_session * | i_session, |
unsigned int | i_value | ||
) |
Sets the result of a request
i_session | a reference to a struct _i_session * |
i_value | the result value Values available are I_OK, I_ERROR, I_ERROR_PARAM, I_ERROR_MEMORY, I_ERROR_UNAUTHORIZED orI_ERROR_SERVER |
int i_set_rich_authorization_request_json_t | ( | struct _i_session * | i_session, |
const char * | type, | ||
json_t * | j_value | ||
) |
Adds an rich authorization request object in JSON format or replace it if the type already exists
i_session | a reference to a struct _i_session * |
type | the type of the authorization request |
j_value | the authorization request, must be a JSON object |
int i_set_rich_authorization_request_str | ( | struct _i_session * | i_session, |
const char * | type, | ||
const char * | value | ||
) |
Adds an rich authorization request object in stringified JSON format or replace it if the type already exists
i_session | a reference to a struct _i_session * |
type | the type of the authorization request |
value | the authorization request, must be a stringified JSON object |
int i_set_server_configuration | ( | struct _i_session * | i_session, |
json_t * | j_openid_config | ||
) |
Sets the server configuration
i_session | a reference to a struct _i_session * |
j_openid_config | the AS openid configuration result |
int i_set_server_jwks | ( | struct _i_session * | i_session, |
json_t * | j_jwks | ||
) |
Sets the server public JWKS
i_session | a reference to a struct _i_session * |
j_jwks | the server public JWKS in json_t * format |
int i_set_str_parameter | ( | struct _i_session * | i_session, |
i_option | option, | ||
const char * | s_value | ||
) |
Sets a char * property value
i_session | a reference to a struct _i_session * |
option | the option to set options available are I_OPT_SCOPE, I_OPT_SCOPE_APPEND, I_OPT_STATE, I_OPT_NONCE, I_OPT_REDIRECT_URI, I_OPT_REDIRECT_TO, I_OPT_CLIENT_ID, I_OPT_CLIENT_SECRET, I_OPT_AUTH_ENDPOINT, I_OPT_TOKEN_ENDPOINT, I_OPT_OPENID_CONFIG_ENDPOINT, I_OPT_OPENID_CONFIG, I_OPT_USERINFO_ENDPOINT, I_OPT_ERROR, I_OPT_ERROR_DESCRIPTION, I_OPT_ERROR_URI, I_OPT_CODE, I_OPT_REFRESH_TOKEN, I_OPT_ACCESS_TOKEN, I_OPT_ID_TOKEN, I_OPT_TOKEN_TYPE, I_OPT_USERNAME, I_OPT_USER_PASSWORD, I_OPT_ISSUER, I_OPT_USERINFO, I_OPT_SERVER_KID, I_OPT_SERVER_ENC_ALG, I_OPT_SERVER_ENC, I_OPT_CLIENT_KID, I_OPT_CLIENT_SIGN_ALG, I_OPT_CLIENT_ENC_ALG, I_OPT_CLIENT_ENC, I_OPT_TOKEN_JTI, I_OPT_TOKEN_TARGET, I_OPT_TOKEN_TARGET_TYPE_HINT, I_OPT_REVOCATION_ENDPOINT, I_OPT_INTROSPECTION_ENDPOINT, I_OPT_REGISTRATION_ENDPOINT, I_OPT_DEVICE_AUTHORIZATION_ENDPOINT, I_OPT_DEVICE_AUTH_CODE, I_OPT_DEVICE_AUTH_USER_CODE, I_OPT_DEVICE_AUTH_VERIFICATION_URI, I_OPT_DEVICE_AUTH_VERIFICATION_URI_COMPLETE, I_OPT_END_SESSION_ENDPOINT, I_OPT_CHECK_SESSION_IRAME, I_OPT_PUSHED_AUTH_REQ_ENDPOINT, I_OPT_PUSHED_AUTH_REQ_URI, I_OPT_DPOP_KID, I_OPT_DPOP_SIGN_ALG, I_OPT_TLS_KEY_FILE, I_OPT_TLS_CERT_FILE, I_OPT_PKCE_CODE_VERIFIER, I_OPT_RESOURCE_INDICATOR, I_OPT_ACCESS_TOKEN_SIGNING_ALG, I_OPT_ACCESS_TOKEN_ENCRYPTION_ALG, I_OPT_ACCESS_TOKEN_ENCRYPTION_ENC, I_OPT_ID_TOKEN_SIGNING_ALG, I_OPT_ID_TOKEN_ENCRYPTION_ALG, I_OPT_ID_TOKEN_ENCRYPTION_ENC, I_OPT_USERINFO_SIGNING_ALG, I_OPT_USERINFO_ENCRYPTION_ALG, I_OPT_USERINFO_ENCRYPTION_ENC, I_OPT_REQUEST_OBJECT_SIGNING_ALG, I_OPT_REQUEST_OBJECT_ENCRYPTION_ALG, I_OPT_REQUEST_OBJECT_ENCRYPTION_ENC, I_OPT_TOKEN_ENDPOINT_SIGNING_ALG, I_OPT_TOKEN_ENDPOINT_ENCRYPTION_ALG, I_OPT_TOKEN_ENDPOINT_ENCRYPTION_ENC, I_OPT_CIBA_REQUEST_SIGNING_ALG, I_OPT_CIBA_REQUEST_ENCRYPTION_ALG, I_OPT_CIBA_REQUEST_ENCRYPTION_ENC, I_OPT_AUTH_RESPONSE_SIGNING_ALG, I_OPT_AUTH_RESPONSE_ENCRYPTION_ALG, I_OPT_AUTH_RESPONSE_ENCRYPTION_ENC, I_OPT_CIBA_ENDPOINT, I_OPT_CIBA_USER_CODE, I_OPT_CIBA_LOGIN_HINT, I_OPT_CIBA_LOGIN_HINT_KID, I_OPT_CIBA_BINDING_MESSAGE, I_OPT_CIBA_CLIENT_NOTIFICATION_TOKEN, I_OPT_CIBA_AUTH_REQ_ID, I_OPT_CIBA_CLIENT_NOTIFICATION_ENDPOINT, I_OPT_FRONTCHANNEL_LOGOUT_URI, I_OPT_BACKCHANNEL_LOGOUT_URI, I_OPT_POST_LOGOUT_REDIRECT_URI, I_OPT_ID_TOKEN_SID, I_OPT_DPOP_NONCE_AS, I_OPT_DPOP_NONCE_RS, I_OPT_HTTP_PROXY |
s_value | The const char * value to set |