Iddawc: include/iddawc.h Source File

Iddawc Handle the flow of OAuth2 and OpenID Connect authentication process from the client side.

iddawc.h
Go to the documentation of this file.
1
24 #ifndef __IDDAWC_H
25 #define __IDDAWC_H
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32 #include <jansson.h>
33 #include <orcania.h>
34 #include <ulfius.h>
35 #include <rhonabwy.h>
36 #include "iddawc-cfg.h"
37
44 #define I_OK 0
45 #define I_ERROR 1
46 #define I_ERROR_PARAM 2
47 #define I_ERROR_MEMORY 3
48 #define I_ERROR_UNAUTHORIZED 4
49 #define I_ERROR_SERVER 5
50
51 #define I_RESPONSE_TYPE_NONE 0x00000000
52 #define I_RESPONSE_TYPE_CODE 0x00000001
53 #define I_RESPONSE_TYPE_TOKEN 0x00000010
54 #define I_RESPONSE_TYPE_ID_TOKEN 0x00000100
55 #define I_RESPONSE_TYPE_PASSWORD 0x00001000
56 #define I_RESPONSE_TYPE_CLIENT_CREDENTIALS 0x00010000
57 #define I_RESPONSE_TYPE_REFRESH_TOKEN 0x00100000
58 #define I_RESPONSE_TYPE_DEVICE_CODE 0x01000000
59
60 #define I_AUTH_METHOD_GET 0x00000001
61 #define I_AUTH_METHOD_POST 0x00000010
62 #define I_AUTH_METHOD_JWT_SIGN_SECRET 0x00000100
63 #define I_AUTH_METHOD_JWT_SIGN_PRIVKEY 0x00001000
64 #define I_AUTH_METHOD_JWT_ENCRYPT_SECRET 0x00010000
65 #define I_AUTH_METHOD_JWT_ENCRYPT_PUBKEY 0x00100000
66
67 #define I_TOKEN_AUTH_METHOD_SECRET_BASIC 0
68 #define I_TOKEN_AUTH_METHOD_SECRET_POST 1
69 #define I_TOKEN_AUTH_METHOD_SECRET_JWT 2
70 #define I_TOKEN_AUTH_METHOD_PRIVATE_JWT 3
71 #define I_TOKEN_AUTH_METHOD_NONE 4
72
73 #define I_STRICT_NO 0
74 #define I_STRICT_YES 1
75
76 #define I_AUTH_SIGN_ALG_MAX_LENGTH 8
77
78 #define I_BEARER_TYPE_HEADER 0
79 #define I_BEARER_TYPE_BODY 1
80 #define I_BEARER_TYPE_URL 2
81
82 #define I_HEADER_PREFIX_BEARER "Bearer "
83 #define I_HEADER_AUTHORIZATION "Authorization"
84 #define I_BODY_URL_PARAMETER "access_token"
85 #define I_HEADER_DPOP "DPoP"
86
91 typedef enum {
92 I_OPT_NONE = 0,
93 I_OPT_RESPONSE_TYPE = 1,
94 I_OPT_SCOPE = 2,
95 I_OPT_SCOPE_APPEND = 3,
96 I_OPT_STATE = 4,
97 I_OPT_NONCE = 5,
98 I_OPT_REDIRECT_URI = 6,
99 I_OPT_REDIRECT_TO = 7,
100 I_OPT_CLIENT_ID = 8,
101 I_OPT_CLIENT_SECRET = 9,
102 I_OPT_ADDITIONAL_PARAMETER = 10,
103 I_OPT_ADDITIONAL_RESPONSE = 11,
104 I_OPT_AUTH_ENDPOINT = 12,
105 I_OPT_TOKEN_ENDPOINT = 13,
106 I_OPT_OPENID_CONFIG_ENDPOINT = 14,
107 I_OPT_OPENID_CONFIG = 15,
108 I_OPT_OPENID_CONFIG_STRICT = 16,
109 I_OPT_USERINFO_ENDPOINT = 17,
110 I_OPT_RESULT = 18,
111 I_OPT_ERROR = 19,
112 I_OPT_ERROR_DESCRIPTION = 20,
113 I_OPT_ERROR_URI = 21,
114 I_OPT_CODE = 22,
115 I_OPT_REFRESH_TOKEN = 23,
116 I_OPT_ACCESS_TOKEN = 24,
117 I_OPT_ID_TOKEN = 25,
118 I_OPT_AUTH_METHOD = 28,
119 I_OPT_TOKEN_METHOD = 29,
120 I_OPT_TOKEN_TYPE = 30,
121 I_OPT_EXPIRES_IN = 31,
122 I_OPT_EXPIRES_AT = 32,
123 I_OPT_USERNAME = 33,
124 I_OPT_USER_PASSWORD = 34,
125 I_OPT_ISSUER = 35,
126 I_OPT_USERINFO = 36,
127 I_OPT_NONCE_GENERATE = 37,
128 I_OPT_STATE_GENERATE = 38,
129 I_OPT_X5U_FLAGS = 39,
130 I_OPT_SERVER_KID = 40,
131 I_OPT_CLIENT_KID = 41,
132 I_OPT_CLIENT_SIGN_ALG = 42,
133 I_OPT_CLIENT_ENC_ALG = 43,
134 I_OPT_CLIENT_ENC = 44,
135 I_OPT_TOKEN_JTI = 45,
136 I_OPT_TOKEN_JTI_GENERATE = 46,
137 I_OPT_TOKEN_EXP = 47,
138 I_OPT_TOKEN_TARGET = 48,
139 I_OPT_TOKEN_TARGET_TYPE_HINT = 49,
140 I_OPT_REVOCATION_ENDPOINT = 50,
141 I_OPT_INTROSPECTION_ENDPOINT = 51,
142 I_OPT_REGISTRATION_ENDPOINT = 52,
143 I_OPT_DEVICE_AUTHORIZATION_ENDPOINT = 53,
144 I_OPT_DEVICE_AUTH_CODE = 54,
145 I_OPT_DEVICE_AUTH_USER_CODE = 55,
146 I_OPT_DEVICE_AUTH_VERIFICATION_URI = 56,
147 I_OPT_DEVICE_AUTH_VERIFICATION_URI_COMPLETE = 57,
148 I_OPT_DEVICE_AUTH_EXPIRES_IN = 58,
149 I_OPT_DEVICE_AUTH_INTERVAL = 59,
150 I_OPT_END_SESSION_ENDPOINT = 60,
151 I_OPT_CHECK_SESSION_IRAME = 61,
152 I_OPT_PUSHED_AUTH_REQ_ENDPOINT = 62,
153 I_OPT_PUSHED_AUTH_REQ_REQUIRED = 63,
154 I_OPT_PUSHED_AUTH_REQ_EXPIRES_IN = 64,
155 I_OPT_PUSHED_AUTH_REQ_URI = 65
156 } i_option;
157
168 struct _i_session {
169 uint response_type;
170 char * scope;
171 char * state;
172 char * nonce;
173 char * redirect_uri;
174 char * redirect_to;
175 char * client_id;
176 char * client_secret;
177 char * username;
178 char * user_password;
179 struct _u_map additional_parameters;
180 struct _u_map additional_response;
181 char * authorization_endpoint;
182 char * token_endpoint;
183 char * openid_config_endpoint;
184 char * userinfo_endpoint;
185 char * revocation_endpoint;
186 char * introspection_endpoint;
187 char * end_session_endpoint;
188 char * check_session_iframe;
189 char * device_authorization_endpoint;
190 char * registration_endpoint;
191 char * pushed_authorization_request_endpoint;
192 uint result;
193 char * error;
194 char * error_description;
195 char * error_uri;
196 char * code;
197 char * refresh_token;
198 char * access_token;
199 char * token_target;
200 char * token_target_type_hint;
201 char * token_type;
202 uint expires_in;
203 time_t expires_at;
204 char * id_token;
205 json_t * id_token_payload;
206 uint auth_method;
207 uint token_method;
208 jwks_t * server_jwks;
209 char * server_kid;
210 jwks_t * client_jwks;
211 char * client_kid;
212 jwa_alg client_sign_alg;
213 jwa_alg client_enc_alg;
214 jwa_enc client_enc;
215 int x5u_flags;
216 json_t * openid_config;
217 int openid_config_strict;
218 char * issuer;
219 char * userinfo;
220 json_t * j_userinfo;
221 char * token_jti;
222 uint token_exp;
223 json_t * j_authorization_details;
224 char * device_auth_code;
225 char * device_auth_user_code;
226 char * device_auth_verifucation_uri;
227 char * device_auth_verifucation_uri_complete;
228 uint device_auth_expires_in;
229 uint device_auth_interval;
230 uint require_pushed_authorization_requests;
231 uint pushed_authorization_request_expires_in;
232 char * pushed_authorization_request_uri;
233 };
234
251 int i_global_init();
252
256 void i_global_close();
257
263 void i_free(void * data);
264
270 int i_init_session(struct _i_session * i_session);
271
276 void i_clean_session(struct _i_session * i_session);
277
300 int i_set_response_type(struct _i_session * i_session, uint i_value);
301
310 int i_set_result(struct _i_session * i_session, uint i_value);
311
321 int i_set_int_parameter(struct _i_session * i_session, i_option option, uint i_value);
322
338 int i_set_str_parameter(struct _i_session * i_session, i_option option, const char * s_value);
339
347 int i_set_additional_parameter(struct _i_session * i_session, const char * s_key, const char * s_value);
348
356 int i_set_additional_response(struct _i_session * i_session, const char * s_key, const char * s_value);
357
365 int i_set_rich_authorization_request(struct _i_session * i_session, const char * type, const char * value);
366
373 int i_remove_rich_authorization_request(struct _i_session * i_session, const char * type);
374
381 char * i_get_rich_authorization_request(struct _i_session * i_session, const char * type);
382
394 uint i_get_response_type(struct _i_session * i_session);
395
401 uint i_get_result(struct _i_session * i_session);
402
411 uint i_get_int_parameter(struct _i_session * i_session, i_option option);
412
427 const char * i_get_str_parameter(struct _i_session * i_session, i_option option);
428
435 const char * i_get_additional_parameter(struct _i_session * i_session, const char * s_key);
436
443 const char * i_get_additional_response(struct _i_session * i_session, const char * s_key);
444
458 int i_set_parameter_list(struct _i_session * i_session, ...);
459
465 json_t * i_export_session_json_t(struct _i_session * i_session);
466
474 int i_import_session_json_t(struct _i_session * i_session, json_t * j_import);
475
481 char * i_export_session_str(struct _i_session * i_session);
482
490 int i_import_session_str(struct _i_session * i_session, const char * str_import);
491
507 int i_load_openid_config(struct _i_session * i_session);
508
515 int i_build_auth_url_get(struct _i_session * i_session);
516
523 int i_run_auth_request(struct _i_session * i_session);
524
532 int i_parse_redirect_to(struct _i_session * i_session);
533
540 int i_run_token_request(struct _i_session * i_session);
541
547 int i_verify_id_token(struct _i_session * i_session);
548
558 int i_load_userinfo(struct _i_session * i_session);
559
573 int i_load_userinfo_custom(struct _i_session * i_session, const char * http_method, struct _u_map * additional_query, struct _u_map * additional_headers);
574
583 int i_introspect_token(struct _i_session * i_session, json_t ** j_result);
584
591 int i_revoke_token(struct _i_session * i_session);
592
604 int i_register_client(struct _i_session * i_session, json_t * j_parameters, int update_session, json_t ** j_result);
605
615 char * i_generate_dpop_token(struct _i_session * i_session, const char * htm, const char * htu, time_t iat);
616
633 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);
634
641 int i_run_par_request(struct _i_session * i_session);
642
649 int i_run_device_auth_request(struct _i_session * i_session);
650
655 #ifdef __cplusplus
656 }
657 #endif
658
659 #endif // __IDDAWC_H_
i_load_userinfo
int i_load_userinfo(struct _i_session *i_session)
Definition: iddawc.c:1735
I_OPT_INTROSPECTION_ENDPOINT
@ I_OPT_INTROSPECTION_ENDPOINT
absolute url for the introspection endpoint, string
Definition: iddawc.h:141
i_import_session_json_t
int i_import_session_json_t(struct _i_session *i_session, json_t *j_import)
Definition: iddawc.c:3040
I_OPT_SCOPE_APPEND
@ I_OPT_SCOPE_APPEND
append another scope value to the scope list, string
Definition: iddawc.h:95
_i_session::revocation_endpoint
char * revocation_endpoint
Definition: iddawc.h:185
i_get_result
uint i_get_result(struct _i_session *i_session)
Definition: iddawc.c:1867
i_parse_redirect_to
int i_parse_redirect_to(struct _i_session *i_session)
Definition: iddawc.c:1921
_i_session::token_exp
uint token_exp
Definition: iddawc.h:222
_i_session::additional_response
struct _u_map additional_response
Definition: iddawc.h:180
_i_session::device_auth_expires_in
uint device_auth_expires_in
Definition: iddawc.h:228
I_OPT_USER_PASSWORD
@ I_OPT_USER_PASSWORD
password for password response_types, string
Definition: iddawc.h:124
I_OPT_ERROR
@ I_OPT_ERROR
error value of a failed request, string
Definition: iddawc.h:111
I_OPT_DEVICE_AUTH_VERIFICATION_URI_COMPLETE
@ I_OPT_DEVICE_AUTH_VERIFICATION_URI_COMPLETE
device authorization verification URI complete sent by the AS
Definition: iddawc.h:147
i_run_device_auth_request
int i_run_device_auth_request(struct _i_session *i_session)
Definition: iddawc.c:3410
i_global_init
int i_global_init()
Definition: iddawc.c:883
i_build_auth_url_get
int i_build_auth_url_get(struct _i_session *i_session)
Definition: iddawc.c:2150
I_OPT_DEVICE_AUTH_USER_CODE
@ I_OPT_DEVICE_AUTH_USER_CODE
device authorization user code sent by the AS
Definition: iddawc.h:145
I_OPT_USERNAME
@ I_OPT_USERNAME
username for password response_types, string
Definition: iddawc.h:123
_i_session::user_password
char * user_password
Definition: iddawc.h:178
I_OPT_REFRESH_TOKEN
@ I_OPT_REFRESH_TOKEN
refresh token given after a succesfull token request using the proper response_type
Definition: iddawc.h:115
I_OPT_AUTH_METHOD
@ I_OPT_AUTH_METHOD
Authentication method to use with the auth endpoint, values available are I_AUTH_METHOD_GET,...
Definition: iddawc.h:118
_i_session
Definition: iddawc.h:168
I_OPT_SCOPE
@ I_OPT_SCOPE
scope values, string, multiple scopes must be separated by a space character: "scope1 openid"
Definition: iddawc.h:94
_i_session::client_enc
jwa_enc client_enc
Definition: iddawc.h:214
I_OPT_TOKEN_METHOD
@ I_OPT_TOKEN_METHOD
Authentication method to use with the token endpoint, values available are I_TOKEN_AUTH_METHOD_SECRET...
Definition: iddawc.h:119
I_OPT_NONCE_GENERATE
@ I_OPT_NONCE_GENERATE
generate a random nonce value
Definition: iddawc.h:127
_i_session::error_uri
char * error_uri
Definition: iddawc.h:195
_i_session::require_pushed_authorization_requests
uint require_pushed_authorization_requests
Definition: iddawc.h:230
I_OPT_DEVICE_AUTH_INTERVAL
@ I_OPT_DEVICE_AUTH_INTERVAL
device authorization code verification interval sent by the AS
Definition: iddawc.h:149
_i_session::redirect_uri
char * redirect_uri
Definition: iddawc.h:173
_i_session::registration_endpoint
char * registration_endpoint
Definition: iddawc.h:190
_i_session::device_auth_user_code
char * device_auth_user_code
Definition: iddawc.h:225
i_global_close
void i_global_close()
Definition: iddawc.c:892
I_OPT_TOKEN_ENDPOINT
@ I_OPT_TOKEN_ENDPOINT
absolute url for the token endpoint, string
Definition: iddawc.h:105
i_introspect_token
int i_introspect_token(struct _i_session *i_session, json_t **j_result)
Definition: iddawc.c:2840
_i_session::expires_at
time_t expires_at
Definition: iddawc.h:203
_i_session::scope
char * scope
Definition: iddawc.h:170
_i_session::response_type
uint response_type
Definition: iddawc.h:169
_i_session::openid_config
json_t * openid_config
Definition: iddawc.h:216
_i_session::device_auth_code
char * device_auth_code
Definition: iddawc.h:224
I_OPT_ERROR_URI
@ I_OPT_ERROR_URI
error uri of a failed request, string
Definition: iddawc.h:113
i_generate_dpop_token
char * i_generate_dpop_token(struct _i_session *i_session, const char *htm, const char *htu, time_t iat)
Definition: iddawc.c:3166
I_OPT_ADDITIONAL_RESPONSE
@ I_OPT_ADDITIONAL_RESPONSE
Definition: iddawc.h:103
I_OPT_NONCE
@ I_OPT_NONCE
nonce value, string
Definition: iddawc.h:97
i_verify_id_token
int i_verify_id_token(struct _i_session *i_session)
Definition: iddawc.c:2645
_i_session::token_endpoint
char * token_endpoint
Definition: iddawc.h:182
_i_session::openid_config_endpoint
char * openid_config_endpoint
Definition: iddawc.h:183
I_OPT_EXPIRES_AT
@ I_OPT_EXPIRES_AT
expires_at value after a succesfull auth or token request, time_t
Definition: iddawc.h:122
_i_session::redirect_to
char * redirect_to
Definition: iddawc.h:174
i_export_session_json_t
json_t * i_export_session_json_t(struct _i_session *i_session)
Definition: iddawc.c:2958
I_OPT_ADDITIONAL_PARAMETER
@ I_OPT_ADDITIONAL_PARAMETER
use this option to pass any additional parameter value in the /auth request
Definition: iddawc.h:102
_i_session::authorization_endpoint
char * authorization_endpoint
Definition: iddawc.h:181
_i_session::openid_config_strict
int openid_config_strict
Definition: iddawc.h:217
_i_session::username
char * username
Definition: iddawc.h:177
_i_session::client_jwks
jwks_t * client_jwks
Definition: iddawc.h:210
I_OPT_USERINFO_ENDPOINT
@ I_OPT_USERINFO_ENDPOINT
absolute url for the userinfo endpoint or equivalent, string
Definition: iddawc.h:109
i_get_int_parameter
uint i_get_int_parameter(struct _i_session *i_session, i_option option)
Definition: iddawc.c:1871
I_OPT_CODE
@ I_OPT_CODE
code given after a succesfull auth request using the response_type I_RESPONSE_TYPE_CODE
Definition: iddawc.h:114
I_OPT_TOKEN_TARGET
@ I_OPT_TOKEN_TARGET
access_token which is the target of a revocation or an introspection, string
Definition: iddawc.h:138
i_free
void i_free(void *data)
Definition: iddawc.c:897
_i_session::userinfo
char * userinfo
Definition: iddawc.h:219
i_register_client
int i_register_client(struct _i_session *i_session, json_t *j_parameters, int update_session, json_t **j_result)
Definition: iddawc.c:2897
I_OPT_OPENID_CONFIG
@ I_OPT_OPENID_CONFIG
result of the .well-known/openid-configuration
Definition: iddawc.h:107
I_OPT_ERROR_DESCRIPTION
@ I_OPT_ERROR_DESCRIPTION
error description of a failed request, string
Definition: iddawc.h:112
I_OPT_CLIENT_ENC_ALG
@ I_OPT_CLIENT_ENC_ALG
key encryption algorithm to use when the client encrypts a request in a JWT, values available are 'RS...
Definition: iddawc.h:133
i_set_str_parameter
int i_set_str_parameter(struct _i_session *i_session, i_option option, const char *s_value)
Definition: iddawc.c:1184
i_remove_rich_authorization_request
int i_remove_rich_authorization_request(struct _i_session *i_session, const char *type)
Definition: iddawc.c:3373
i_clean_session
void i_clean_session(struct _i_session *i_session)
Definition: iddawc.c:998
i_run_auth_request
int i_run_auth_request(struct _i_session *i_session)
Definition: iddawc.c:2274
i_get_response_type
uint i_get_response_type(struct _i_session *i_session)
Definition: iddawc.c:1863
_i_session::client_kid
char * client_kid
Definition: iddawc.h:211
_i_session::refresh_token
char * refresh_token
Definition: iddawc.h:197
_i_session::userinfo_endpoint
char * userinfo_endpoint
Definition: iddawc.h:184
_i_session::client_sign_alg
jwa_alg client_sign_alg
Definition: iddawc.h:212
I_OPT_DEVICE_AUTH_CODE
@ I_OPT_DEVICE_AUTH_CODE
device authorization code sent by the AS
Definition: iddawc.h:144
_i_session::issuer
char * issuer
Definition: iddawc.h:218
i_get_additional_parameter
const char * i_get_additional_parameter(struct _i_session *i_session, const char *s_key)
Definition: iddawc.c:2134
I_OPT_PUSHED_AUTH_REQ_URI
@ I_OPT_PUSHED_AUTH_REQ_URI
request_uri sent by the par endpoint result, string
Definition: iddawc.h:155
_i_session::id_token
char * id_token
Definition: iddawc.h:204
i_set_response_type
int i_set_response_type(struct _i_session *i_session, uint i_value)
Definition: iddawc.c:1051
_i_session::error_description
char * error_description
Definition: iddawc.h:194
I_OPT_DEVICE_AUTH_EXPIRES_IN
@ I_OPT_DEVICE_AUTH_EXPIRES_IN
device authorization code expiration sent by the AS
Definition: iddawc.h:148
_i_session::client_secret
char * client_secret
Definition: iddawc.h:176
I_OPT_STATE_GENERATE
@ I_OPT_STATE_GENERATE
generate a random state value
Definition: iddawc.h:128
i_run_token_request
int i_run_token_request(struct _i_session *i_session)
Definition: iddawc.c:2379
_i_session::token_target_type_hint
char * token_target_type_hint
Definition: iddawc.h:200
I_OPT_RESPONSE_TYPE
@ I_OPT_RESPONSE_TYPE
response_type, values available are I_RESPONSE_TYPE_CODE, I_RESPONSE_TYPE_TOKEN, I_RESPONSE_TYPE_ID_T...
Definition: iddawc.h:93
_i_session::end_session_endpoint
char * end_session_endpoint
Definition: iddawc.h:187
i_load_userinfo_custom
int i_load_userinfo_custom(struct _i_session *i_session, const char *http_method, struct _u_map *additional_query, struct _u_map *additional_headers)
Definition: iddawc.c:1747
I_OPT_CHECK_SESSION_IRAME
@ I_OPT_CHECK_SESSION_IRAME
absolute url for the check session iframe, string
Definition: iddawc.h:151
_i_session::device_auth_interval
uint device_auth_interval
Definition: iddawc.h:229
i_revoke_token
int i_revoke_token(struct _i_session *i_session)
Definition: iddawc.c:2785
I_OPT_REDIRECT_TO
@ I_OPT_REDIRECT_TO
url where the oauth2 is redirected to after a /auth request
Definition: iddawc.h:99
_i_session::token_type
char * token_type
Definition: iddawc.h:201
I_OPT_REGISTRATION_ENDPOINT
@ I_OPT_REGISTRATION_ENDPOINT
absolute url for the client registration endpoint, string
Definition: iddawc.h:142
I_OPT_EXPIRES_IN
@ I_OPT_EXPIRES_IN
expires_in value after a succesfull auth or token request, integer
Definition: iddawc.h:121
_i_session::x5u_flags
int x5u_flags
Definition: iddawc.h:215
I_OPT_SERVER_KID
@ I_OPT_SERVER_KID
key id to use if multiple jwk are available on the server, string
Definition: iddawc.h:130
i_set_additional_parameter
int i_set_additional_parameter(struct _i_session *i_session, const char *s_key, const char *s_value)
Definition: iddawc.c:1570
_i_session::j_userinfo
json_t * j_userinfo
Definition: iddawc.h:220
I_OPT_PUSHED_AUTH_REQ_EXPIRES_IN
@ I_OPT_PUSHED_AUTH_REQ_EXPIRES_IN
pushed authorization request expiration time in seconds
Definition: iddawc.h:154
I_OPT_CLIENT_SECRET
@ I_OPT_CLIENT_SECRET
client secret, string
Definition: iddawc.h:101
_i_session::error
char * error
Definition: iddawc.h:193
_i_session::result
uint result
Definition: iddawc.h:192
I_OPT_PUSHED_AUTH_REQ_ENDPOINT
@ I_OPT_PUSHED_AUTH_REQ_ENDPOINT
absolute url for the pushed authoization endpoint, string
Definition: iddawc.h:152
I_OPT_CLIENT_KID
@ I_OPT_CLIENT_KID
key id to use if multiple jwk are available on the client, string
Definition: iddawc.h:131
i_option
i_option
Definition: iddawc.h:91
I_OPT_STATE
@ I_OPT_STATE
state value, string
Definition: iddawc.h:96
i_init_session
int i_init_session(struct _i_session *i_session)
Definition: iddawc.c:901
_i_session::expires_in
uint expires_in
Definition: iddawc.h:202
I_OPT_DEVICE_AUTHORIZATION_ENDPOINT
@ I_OPT_DEVICE_AUTHORIZATION_ENDPOINT
absolute url for the pushed authorization endpoint, string
Definition: iddawc.h:143
_i_session::device_authorization_endpoint
char * device_authorization_endpoint
Definition: iddawc.h:189
I_OPT_OPENID_CONFIG_ENDPOINT
@ I_OPT_OPENID_CONFIG_ENDPOINT
absolute url for the .well-known/openid-configuration endpoint, string
Definition: iddawc.h:106
_i_session::pushed_authorization_request_expires_in
uint pushed_authorization_request_expires_in
Definition: iddawc.h:231
_i_session::server_kid
char * server_kid
Definition: iddawc.h:209
i_get_additional_response
const char * i_get_additional_response(struct _i_session *i_session, const char *s_key)
Definition: iddawc.c:2142
I_OPT_X5U_FLAGS
@ I_OPT_X5U_FLAGS
x5u flage to apply when JWK used have a x5u property, values available are R_FLAG_IGNORE_SERVER_CERTI...
Definition: iddawc.h:129
_i_session::nonce
char * nonce
Definition: iddawc.h:172
i_get_str_parameter
const char * i_get_str_parameter(struct _i_session *i_session, i_option option)
Definition: iddawc.c:1993
i_load_openid_config
int i_load_openid_config(struct _i_session *i_session)
Definition: iddawc.c:1694
I_OPT_CLIENT_SIGN_ALG
@ I_OPT_CLIENT_SIGN_ALG
signature algorithm to use when the client signs a request in a JWT, values available are 'none',...
Definition: iddawc.h:132
I_OPT_USERINFO
@ I_OPT_USERINFO
userinfo result, string
Definition: iddawc.h:126
I_OPT_DEVICE_AUTH_VERIFICATION_URI
@ I_OPT_DEVICE_AUTH_VERIFICATION_URI
device authorization verification URI sent by the AS
Definition: iddawc.h:146
I_OPT_CLIENT_ENC
@ I_OPT_CLIENT_ENC
data encryption algorithm to use when the client encrypts a request in a JWT, values available are 'A...
Definition: iddawc.h:134
_i_session::additional_parameters
struct _u_map additional_parameters
Definition: iddawc.h:179
I_OPT_REVOCATION_ENDPOINT
@ I_OPT_REVOCATION_ENDPOINT
absolute url for the revocation endpoint, string
Definition: iddawc.h:140
_i_session::client_enc_alg
jwa_alg client_enc_alg
Definition: iddawc.h:213
I_OPT_PUSHED_AUTH_REQ_REQUIRED
@ I_OPT_PUSHED_AUTH_REQ_REQUIRED
are pushed authorization requests required, boolean
Definition: iddawc.h:153
I_OPT_TOKEN_JTI_GENERATE
@ I_OPT_TOKEN_JTI_GENERATE
generate a random jti value
Definition: iddawc.h:136
I_OPT_TOKEN_EXP
@ I_OPT_TOKEN_EXP
JWT token request expiration time in seconds.
Definition: iddawc.h:137
i_set_additional_response
int i_set_additional_response(struct _i_session *i_session, const char *s_key, const char *s_value)
Definition: iddawc.c:1582
I_OPT_NONE
@ I_OPT_NONE
Empty option to complete a i_set_parameter_list.
Definition: iddawc.h:92
I_OPT_END_SESSION_ENDPOINT
@ I_OPT_END_SESSION_ENDPOINT
absolute url for the end session endpoint, string
Definition: iddawc.h:150
I_OPT_ISSUER
@ I_OPT_ISSUER
issuer value, string
Definition: iddawc.h:125
I_OPT_TOKEN_TYPE
@ I_OPT_TOKEN_TYPE
token_type value after a succesfull auth or token request, string
Definition: iddawc.h:120
I_OPT_AUTH_ENDPOINT
@ I_OPT_AUTH_ENDPOINT
absolute url for the auth endpoint, string
Definition: iddawc.h:104
i_run_par_request
int i_run_par_request(struct _i_session *i_session)
Definition: iddawc.c:3482
I_OPT_ACCESS_TOKEN
@ I_OPT_ACCESS_TOKEN
access token given after a succesfull auth or token request using the proper response_type
Definition: iddawc.h:116
_i_session::check_session_iframe
char * check_session_iframe
Definition: iddawc.h:188
_i_session::token_method
uint token_method
Definition: iddawc.h:207
_i_session::introspection_endpoint
char * introspection_endpoint
Definition: iddawc.h:186
_i_session::code
char * code
Definition: iddawc.h:196
i_export_session_str
char * i_export_session_str(struct _i_session *i_session)
Definition: iddawc.c:3137
_i_session::state
char * state
Definition: iddawc.h:171
I_OPT_REDIRECT_URI
@ I_OPT_REDIRECT_URI
redirect_uri, string
Definition: iddawc.h:98
_i_session::pushed_authorization_request_uri
char * pushed_authorization_request_uri
Definition: iddawc.h:232
_i_session::device_auth_verifucation_uri_complete
char * device_auth_verifucation_uri_complete
Definition: iddawc.h:227
i_set_parameter_list
int i_set_parameter_list(struct _i_session *i_session,...)
Definition: iddawc.c:1594
i_import_session_str
int i_import_session_str(struct _i_session *i_session, const char *str_import)
Definition: iddawc.c:3148
_i_session::device_auth_verifucation_uri
char * device_auth_verifucation_uri
Definition: iddawc.h:226
_i_session::client_id
char * client_id
Definition: iddawc.h:175
_i_session::j_authorization_details
json_t * j_authorization_details
Definition: iddawc.h:223
i_perform_api_request
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)
Definition: iddawc.c:3249
I_OPT_ID_TOKEN
@ I_OPT_ID_TOKEN
id_token given after a succesfull auth or token request using the proper response_type
Definition: iddawc.h:117
_i_session::id_token_payload
json_t * id_token_payload
Definition: iddawc.h:205
I_OPT_TOKEN_TARGET_TYPE_HINT
@ I_OPT_TOKEN_TARGET_TYPE_HINT
access_token which is the target of a revocation or an introspection, string
Definition: iddawc.h:139
_i_session::pushed_authorization_request_endpoint
char * pushed_authorization_request_endpoint
Definition: iddawc.h:191
I_OPT_RESULT
@ I_OPT_RESULT
result of a request
Definition: iddawc.h:110
I_OPT_OPENID_CONFIG_STRICT
@ I_OPT_OPENID_CONFIG_STRICT
must the .well-known/openid-configuration parameters be strictly
Definition: iddawc.h:108
_i_session::token_jti
char * token_jti
Definition: iddawc.h:221
_i_session::access_token
char * access_token
Definition: iddawc.h:198
_i_session::token_target
char * token_target
Definition: iddawc.h:199
i_set_int_parameter
int i_set_int_parameter(struct _i_session *i_session, i_option option, uint i_value)
Definition: iddawc.c:1059
i_set_rich_authorization_request
int i_set_rich_authorization_request(struct _i_session *i_session, const char *type, const char *value)
Definition: iddawc.c:3339
i_get_rich_authorization_request
char * i_get_rich_authorization_request(struct _i_session *i_session, const char *type)
Definition: iddawc.c:3393
i_set_result
int i_set_result(struct _i_session *i_session, uint i_value)
Definition: iddawc.c:1055
I_OPT_TOKEN_JTI
@ I_OPT_TOKEN_JTI
jti value, string
Definition: iddawc.h:135
I_OPT_CLIENT_ID
@ I_OPT_CLIENT_ID
client_id, string
Definition: iddawc.h:100
_i_session::server_jwks
jwks_t * server_jwks
Definition: iddawc.h:208
_i_session::auth_method
uint auth_method
Definition: iddawc.h:206