Manipulates inner data of the session.
More...
|
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) |
|
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.
◆ i_set_response_type()
int i_set_response_type |
( |
struct _i_session * |
i_session, |
|
|
uint |
i_value |
|
) |
| |
Sets response type of a session
- Parameters
-
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 |
- Returns
- I_OK on success, an error value on error
◆ i_set_result()
int i_set_result |
( |
struct _i_session * |
i_session, |
|
|
uint |
i_value |
|
) |
| |
Sets the result of a request
- Parameters
-
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 |
- Returns
- I_OK on success, an error value on error
◆ i_set_int_parameter()
Sets an unsigned integer property value
- Parameters
-
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 |
- Returns
- I_OK on success, an error value on error
◆ i_set_str_parameter()
int i_set_str_parameter |
( |
struct _i_session * |
i_session, |
|
|
i_option |
option, |
|
|
const char * |
s_value |
|
) |
| |
Sets a char * property value
- Parameters
-
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 |
- Returns
- I_OK on success, an error value on error
◆ i_set_additional_parameter()
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
- Parameters
-
i_session | a reference to a struct _i_session * |
s_key | the key to set |
s_value | the value to set |
- Returns
- I_OK on success, an error value on error
◆ i_set_additional_response()
int i_set_additional_response |
( |
struct _i_session * |
i_session, |
|
|
const char * |
s_key, |
|
|
const char * |
s_value |
|
) |
| |
Sets an additional response value
- Parameters
-
i_session | a reference to a struct _i_session * |
s_key | the key to set |
s_value | the value to set |
- Returns
- I_OK on success, an error value on error
◆ i_get_response_type()
uint i_get_response_type |
( |
struct _i_session * |
i_session | ) |
|
Returns the response type of the current session
- Parameters
-
- Returns
- a value among the following: 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
◆ i_get_result()
uint i_get_result |
( |
struct _i_session * |
i_session | ) |
|
Returns the result of the last oauth2 request
- Parameters
-
- Returns
- I_OK on success, an error value on error
◆ i_get_int_parameter()
Returns the integer value of an option
- Parameters
-
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 |
- Returns
- the option value
◆ i_get_str_parameter()
Returns the char * value of an option
- Parameters
-
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 |
- Returns
- the char * value of the option, NULL if no value set
◆ i_get_additional_parameter()
const char* i_get_additional_parameter |
( |
struct _i_session * |
i_session, |
|
|
const char * |
s_key |
|
) |
| |
Gets an additional parameter for auth or token requests
- Parameters
-
i_session | a reference to a struct _i_session * |
s_key | the key to get |
- Returns
- the value
◆ i_get_additional_response()
const char* i_get_additional_response |
( |
struct _i_session * |
i_session, |
|
|
const char * |
s_key |
|
) |
| |
Gets an additional response from auth or token requests
- Parameters
-
i_session | a reference to a struct _i_session * |
s_key | the key to get |
- Returns
- the value
◆ i_set_parameter_list()
int i_set_parameter_list |
( |
struct _i_session * |
i_session, |
|
|
|
... |
|
) |
| |
Sets a list of parameters to a session
- Parameters
-
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); |
- Returns
- I_OK on success, an error value on error
◆ i_export_session_json_t()
json_t* i_export_session_json_t |
( |
struct _i_session * |
i_session | ) |
|
Exports a _i_session * into a json_t * object
- Parameters
-
- Returns
- a json_t * object containing all data set in the session
◆ i_import_session_json_t()
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
- Parameters
-
i_session | a reference to a struct _i_session * |
j_import | a json_t * object in i_export_session_json_t format |
- Returns
- I_OK on success, an error value on error
◆ i_export_session_str()
char* i_export_session_str |
( |
struct _i_session * |
i_session | ) |
|
Exports a _i_session * into a json_t * object
- Parameters
-
- Returns
- a char * containing a JSON stringified exported session
◆ i_import_session_str()
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
- Parameters
-
i_session | a reference to a struct _i_session * |
str_import | a char * containing a JSON stringified session |
- Returns
- I_OK on success, an error value on error