Iddawc
Handle the flow of OAuth2 and OpenID Connect authentication process from the client side.
Functions
iddawc.c File Reference
#include <stdarg.h>
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
#include <yder.h>
#include <rhonabwy.h>
#include "iddawc.h"

Functions

unsigned char random_at_most (unsigned char max, int nonce)
 
char * rand_string_nonce (char *str, size_t str_size)
 
int i_global_init ()
 
void i_global_close ()
 
void i_free (void *data)
 
int i_init_session (struct _i_session *i_session)
 
void i_clean_session (struct _i_session *i_session)
 
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_parameter_list (struct _i_session *i_session,...)
 
int i_load_openid_config (struct _i_session *i_session)
 
int i_load_userinfo (struct _i_session *i_session)
 
int i_load_userinfo_custom (struct _i_session *i_session, const char *http_method, struct _u_map *additional_query, struct _u_map *additional_headers)
 
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)
 
int i_parse_redirect_to (struct _i_session *i_session)
 
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_build_auth_url_get (struct _i_session *i_session)
 
int i_run_auth_request (struct _i_session *i_session)
 
int i_run_token_request (struct _i_session *i_session)
 
int i_verify_id_token (struct _i_session *i_session)
 
int i_revoke_token (struct _i_session *i_session)
 
int i_introspect_token (struct _i_session *i_session, json_t **j_result)
 
int i_register_client (struct _i_session *i_session, json_t *j_parameters, int update_session, json_t **j_result)
 
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)
 
char * i_generate_dpop_token (struct _i_session *i_session, const char *htm, const char *htu, time_t iat)
 
int i_perform_api_request (struct _i_session *i_session, struct _u_request *http_request, struct _u_response *http_response, int refresh_if_expired, int bearer_type, int use_dpop, time_t dpop_iat)
 
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)
 
int i_run_device_auth_request (struct _i_session *i_session)
 
int i_run_par_request (struct _i_session *i_session)
 

Function Documentation

◆ random_at_most()

unsigned char random_at_most ( unsigned char  max,
int  nonce 
)

Iddawc OAuth2 client library

iddawc.h: structures and functions declarations

Copyright 2019-2020 Nicolas Mora mail@.nosp@m.babe.nosp@m.loues.nosp@m.t.or.nosp@m.g

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses/. Generates a random long integer between 0 and max

◆ rand_string_nonce()

char* rand_string_nonce ( char *  str,
size_t  str_size 
)

Generates a random string used as nonce and store it in str