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, uint i_value) |
int | i_set_result (struct _i_session *i_session, uint i_value) |
int | i_set_int_parameter (struct _i_session *i_session, i_option option, uint 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_set_rich_authorization_request (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) |
char * | i_get_rich_authorization_request (struct _i_session *i_session, const char *type) |
uint | i_get_response_type (struct _i_session *i_session) |
uint | i_get_result (struct _i_session *i_session) |
uint | 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) |
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) |
Manipulates inner data of the session
int i_set_response_type | ( | struct _i_session * | i_session, |
uint | 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 and I_RESPONSE_TYPE_REFRESH_TOKEN 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, |
uint | 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_int_parameter | ( | struct _i_session * | i_session, |
i_option | option, | ||
uint | 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_RESPONSE_TYPE, I_OPT_RESULT, I_OPT_AUTH_METHOD I_OPT_EXPIRES_IN, I_OPT_OPENID_CONFIG_STRICT |
i_value | The unsigned integer value to set |
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_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_GLEWLWYD_API_URL, I_OPT_GLEWLWYD_COOKIE_SESSION, I_OPT_TOKEN_TYPE, I_OPT_USERNAME, I_OPT_USER_PASSWORD, I_OPT_OPENID_CONFIG, I_OPT_ISSUER |
s_value | The char * value to set |
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_rich_authorization_request | ( | struct _i_session * | i_session, |
const char * | type, | ||
const char * | value | ||
) |
Adds an authorization request object 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_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 |
char* i_get_rich_authorization_request | ( | 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 |
uint 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 * |
uint 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 * |
uint 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_RESPONSE_TYPE, I_OPT_RESULT, I_OPT_AUTH_METHOD I_OPT_EXPIRES_IN, I_OPT_OPENID_CONFIG_STRICT |
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_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_GLEWLWYD_API_URL, I_OPT_GLEWLWYD_COOKIE_SESSION, I_OPT_TOKEN_TYPE, I_OPT_USERNAME, I_OPT_USER_PASSWORD, I_OPT_OPENID_CONFIG, I_OPT_ISSUER |
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 |
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); |
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 * |
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 |
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 * |
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 |