42#include "gnunet_signatures.h"
43#include "microhttpd.h"
49#define GNUNET_REST_API_NS_OIDC "/openid"
54#define GNUNET_REST_API_NS_OIDC_CONFIG "/.well-known/openid-configuration"
59#define GNUNET_REST_API_NS_AUTHORIZE "/openid/authorize"
64#define GNUNET_REST_API_NS_TOKEN "/openid/token"
69#define GNUNET_REST_API_JWKS "/jwks.json"
74#define GNUNET_REST_API_NS_USERINFO "/openid/userinfo"
79#define GNUNET_REST_API_NS_LOGIN "/openid/login"
84#define ID_REST_STATE_INIT 0
89#define ID_REST_STATE_POST_INIT 1
94#define OIDC_GRANT_TYPE_KEY "grant_type"
99#define OIDC_GRANT_TYPE_VALUE "authorization_code"
104#define OIDC_CODE_KEY "code"
109#define OIDC_RESPONSE_TYPE_KEY "response_type"
114#define OIDC_CLIENT_ID_KEY "client_id"
119#define OIDC_SCOPE_KEY "scope"
124#define OIDC_REDIRECT_URI_KEY "redirect_uri"
129#define OIDC_STATE_KEY "state"
134#define OIDC_NONCE_KEY "nonce"
139#define OIDC_CLAIMS_KEY "claims"
144#define OIDC_CODE_CHALLENGE_KEY "code_challenge"
149#define OIDC_CODE_VERIFIER_KEY "code_verifier"
154#define OIDC_COOKIE_EXPIRATION 3
159#define OIDC_COOKIE_HEADER_KEY "cookie"
164#define OIDC_AUTHORIZATION_HEADER_KEY "authorization"
169#define OIDC_COOKIE_HEADER_INFORMATION_KEY "Identity="
174#define OIDC_COOKIE_HEADER_ACCESS_DENIED "Identity=Denied"
179#define OIDC_EXPECTED_AUTHORIZATION_RESPONSE_TYPE "code"
184#define OIDC_EXPECTED_AUTHORIZATION_SCOPE "openid"
189#define OIDC_ERROR_KEY_INVALID_CLIENT "invalid_client"
194#define OIDC_ERROR_KEY_INVALID_SCOPE "invalid_scope"
199#define OIDC_ERROR_KEY_INVALID_REQUEST "invalid_request"
204#define OIDC_ERROR_KEY_INVALID_TOKEN "invalid_token"
209#define OIDC_ERROR_KEY_INVALID_COOKIE "invalid_cookie"
214#define OIDC_ERROR_KEY_SERVER_ERROR "server_error"
219#define OIDC_ERROR_KEY_UNSUPPORTED_GRANT_TYPE "unsupported_grant_type"
224#define OIDC_ERROR_KEY_UNSUPPORTED_RESPONSE_TYPE "unsupported_response_type"
229#define OIDC_ERROR_KEY_UNAUTHORIZED_CLIENT "unauthorized_client"
234#define OIDC_ERROR_KEY_ACCESS_DENIED "access_denied"
239#define OIDC_JWK_RSA_FILENAME "jwk_rsa.json"
244#define CONSUME_TIMEOUT GNUNET_TIME_relative_multiply ( \
245 GNUNET_TIME_UNIT_SECONDS,2)
605 if (NULL !=
handle->timeout_task)
607 if (NULL !=
handle->attr_it)
609 if (NULL !=
handle->cred_it)
611 if (NULL !=
handle->ticket_it)
613 if (NULL !=
handle->idp_op)
615 if (NULL !=
handle->consume_timeout_op)
623 if (NULL !=
handle->gns_op)
634 if (NULL !=
handle->oidc->claims)
636 if (NULL !=
handle->oidc->code_challenge)
640 if (NULL!=
handle->attr_idtoken_list)
642 if (NULL!=
handle->attr_userinfo_list)
644 if (NULL!=
handle->credentials)
646 if (NULL!=
handle->presentations)
651 if (NULL !=
handle->access_token)
666 struct MHD_Response *resp;
670 "{ \"error\" : \"%s\", \"error_description\" : \"%s\"%s%s%s}",
673 (NULL !=
handle->oidc->state) ?
", \"state\":\"" :
"",
674 (NULL !=
handle->oidc->state) ?
handle->oidc->state :
"",
675 (NULL !=
handle->oidc->state) ?
"\"" :
"");
676 if (0 ==
handle->response_code)
681 MHD_add_response_header (resp,
682 MHD_HTTP_HEADER_WWW_AUTHENTICATE,
685 MHD_HTTP_HEADER_CONTENT_TYPE,
686 "application/json"));
703 struct MHD_Response *resp;
707 "Error: %s\n",
handle->edesc);
709 "error=\"%s\", error_description=\"%s\"",
714 MHD_add_response_header (resp,
715 MHD_HTTP_HEADER_WWW_AUTHENTICATE,
732 struct MHD_Response *resp;
736 "%s?error=%s&error_description=%s%s%s",
737 handle->oidc->redirect_uri,
740 (NULL !=
handle->oidc->state) ?
"&state=" :
"",
741 (NULL !=
handle->oidc->state) ?
handle->oidc->state :
"");
744 "Location", redirect));
761 handle->timeout_task = NULL;
778 struct MHD_Response *resp;
783 MHD_add_response_header (resp,
"Access-Control-Allow-Methods",
allow_methods);
799 char delimiter[] =
"; ";
820 token = strtok (cookies, delimiter);
822 handle->oidc->login_identity = NULL;
826 "Unable to parse cookie: %s\n",
832 while (NULL != token)
842 token = strtok (NULL, delimiter);
847 "No cookie value to process: %s\n",
858 "Found cookie `%s', but no corresponding expiration entry present...\n",
870 "Found cookie `%s', but it is expired.\n",
896 jwk = json_load_file (
filename, JSON_DECODE_ANY, &error);
901 (
"Could not read OIDC RSA key from config file; %s\n"),
920 if (json_dump_file (jwk,
filename, JSON_INDENT (2)))
923 (
"Could not write OIDC RSA key to file %s\n"),
941 jwk = json_pack (
"{s:s,s:i}",
"kty",
"RSA",
"bits", 2048);
942 jose_jwk_gen (NULL, jwk);
956 char *oidc_directory;
961 "reclaim-rest-plugin",
973 return oidc_directory;
985 char *oidc_directory;
994 return oidc_jwk_path;
1004 char *login_base_url;
1007 struct MHD_Response *resp;
1012 "reclaim-rest-plugin",
1020 handle->oidc->response_type);
1024 handle->oidc->client_id);
1026 handle->oidc->redirect_uri,
1041 if (NULL !=
handle->oidc->state)
1052 if (NULL !=
handle->oidc->code_challenge)
1057 handle->oidc->code_challenge);
1059 if (NULL !=
handle->oidc->nonce)
1066 if (NULL !=
handle->oidc->claims)
1079 MHD_add_response_header (resp,
"Location", new_redirect);
1121 struct MHD_Response *resp;
1140 handle->attr_idtoken_list,
1143 handle->oidc->code_challenge);
1144 if ((NULL !=
handle->redirect_prefix) && (NULL !=
handle->redirect_suffix) &&
1148 "%s.%s/%s%s%s=%s&state=%s",
1152 (NULL == strchr (
handle->redirect_suffix,
'?') ?
"?" :
1154 handle->oidc->response_type,
1161 "%s%s%s=%s&state=%s",
1162 handle->oidc->redirect_uri,
1163 (NULL == strchr (
handle->oidc->redirect_uri,
'?') ?
"?" :
1165 handle->oidc->response_type,
1171 "Location", redirect_uri));
1190 for (le_a = list_a->
list_head; NULL != le_a; le_a = le_a->
next)
1207 for (le_b = list_b->
list_head; NULL != le_b; le_b = le_b->
next)
1209 for (le_m = merged_list->
list_head; NULL != le_m; le_m = le_m->
next)
1244 handle->attr_userinfo_list);
1245 for (le_m = merged_list->
list_head; NULL != le_m; le_m = le_m->
next)
1247 "List Attribute in ticket to issue: %s\n",
1251 &
handle->oidc->client_pkey,
1271 for (ale =
handle->credentials->list_head; NULL != ale; ale = ale->
next)
1281 for (le =
handle->attr_idtoken_list->list_head; NULL != le; le = le->
next)
1293 handle->credentials->list_tail,
1306 handle->ticket_it = NULL;
1307 if (NULL ==
handle->attr_idtoken_list->list_head)
1331 const char *claims_parameter)
1346 if (NULL !=
handle->oidc->claims)
1348 root = json_loads (
handle->oidc->claims, JSON_DECODE_ANY, &error);
1349 claims_j = json_object_get (root, claims_parameter);
1351 if (NULL != claims_j)
1353 json_object_foreach (claims_j,
key,
value) {
1404 handle->attr_idtoken_list->list_tail,
1419 handle->attr_userinfo_list->list_tail,
1439 char *identity_cookie;
1443 handle->oidc->login_identity);
1463 GNUNET_strdup (
"The cookie of a login identity is not valid");
1476 handle->attr_idtoken_list =
1478 handle->attr_userinfo_list =
1503 struct MHD_Response *resp;
1508 if ((NULL !=
handle->redirect_prefix) &&
1509 (NULL !=
handle->redirect_suffix) && (NULL !=
handle->tld))
1512 "%s.%s/%s?error=%s&error_description=%s&state=%s",
1517 "User denied access",
1523 "%s?error=%s&error_description=%s&state=%s",
1524 handle->oidc->redirect_uri,
1526 "User denied access",
1558 GNUNET_strdup (
"Server cannot generate ticket, redirect uri not found.");
1569 if (NULL == strstr (tmp,
handle->oidc->client_id))
1572 "Redirect uri %s does not contain client_id %s\n",
1574 handle->oidc->client_id);
1578 pos = strrchr (tmp, (
unsigned char)
'.');
1582 "Redirect uri %s contains client_id but is malformed\n",
1589 tmp_key_str = pos + 1;
1590 pos = strchr (tmp_key_str, (
unsigned char)
'/');
1594 "Redirect uri %s contains client_id but is malformed\n",
1603 strlen (tmp_key_str),
1605 sizeof(redirect_zone));
1613 GNUNET_strdup (
"Server cannot generate ticket, redirect uri not found.");
1630 &
handle->oidc->client_pkey,
1671 char *expected_scope;
1672 char delimiter[] =
" ";
1673 int number_of_ignored_parameter, iterator;
1677 handle->oidc->redirect_uri =
1679 if (NULL ==
handle->oidc->redirect_uri)
1688 handle->oidc->response_type =
1690 if (NULL ==
handle->oidc->response_type)
1700 if (NULL ==
handle->oidc->scope)
1715 number_of_ignored_parameter =
1717 for (iterator = 0; iterator < number_of_ignored_parameter; iterator++)
1729 "Server will not handle parameter: %s",
1737 if (0 != strcmp (
handle->oidc->response_type,
1742 "obtaining this authorization code.");
1750 test = strtok (expected_scope, delimiter);
1751 while (NULL != test)
1755 test = strtok (NULL, delimiter);
1761 GNUNET_strdup (
"The requested scope is invalid, unknown, or malformed.");
1768 if ((NULL ==
handle->oidc->login_identity) &&
1820 if (NULL ==
handle->oidc->client_id)
1832 if (NULL ==
handle->oidc->code_challenge)
1835 "OAuth authorization request does not contain PKCE parameters!\n");
1840 &
handle->oidc->client_pkey))
1844 "authorization code using this method.");
1852 for (tmp_ego =
ego_head; NULL != tmp_ego; tmp_ego = tmp_ego->
next)
1893 char term_data[
handle->rest_handle->data_size + 1];
1895 term_data[
handle->rest_handle->data_size] =
'\0';
1897 handle->rest_handle->data,
1898 handle->rest_handle->data_size);
1899 root = json_loads (term_data, JSON_DECODE_ANY, &error);
1900 identity = json_object_get (root,
"identity");
1904 "Error parsing json string from %s\n",
1917 "Set-Cookie", header_val));
1919 MHD_add_response_header (resp,
1920 "Access-Control-Allow-Methods",
1924 if (0 != strcmp (json_string_value (
identity),
"Denied"))
1949 char **client_secret)
1952 char *authorization;
1954 char *basic_authorization;
1955 char *client_id_tmp;
1970 credentials = strtok (authorization,
" ");
1971 if ((NULL == credentials) || (0 != strcmp (
"Basic", credentials)))
1973 credentials = strtok (NULL,
" ");
1974 if (NULL == credentials)
1977 strlen (credentials),
1978 (
void **) &basic_authorization);
1980 if (NULL == basic_authorization)
1982 client_id_tmp = strtok (basic_authorization,
":");
1983 if (NULL == client_id_tmp)
1988 pass = strtok (NULL,
":");
1994 *client_id = strdup (client_id_tmp);
1995 *client_secret = strdup (pass);
2004 char **client_secret)
2007 char *client_id_tmp;
2011 strlen (
"client_id"),
2018 handle->rest_handle->url_param_map,
2020 if (NULL == client_id_tmp)
2022 *client_id = strdup (client_id_tmp);
2024 strlen (
"client_secret"),
2042 *client_secret = strdup (pass);
2051 char *expected_pass;
2061 "Received client credentials in HTTP AuthZ header\n");
2068 "Received client credentials in POST body\n");
2074 if (NULL == pkce_cv)
2084 strlen (received_cid),
2094 "reclaim-rest-plugin",
2095 "OIDC_CLIENT_HMAC_SECRET",
2098 if (0 != strcmp (expected_pass, received_cpw))
2122 if (0 == strcmp (
handle->ego_entry->keystring, received_cid))
2125 if (NULL ==
handle->ego_entry)
2134 strlen (received_cid),
2151 for (ego_entry =
ego_head; NULL != ego_entry;
2152 ego_entry = ego_entry->
next)
2175 const struct EgoEntry *ego_entry = NULL;
2182 struct MHD_Response *resp = NULL;
2183 char *grant_type = NULL;
2185 char *json_response = NULL;
2186 char *id_token = NULL;
2187 char *access_token = NULL;
2189 char *jwt_secret = NULL;
2191 char *code_verifier = NULL;
2193 char *oidc_jwk_path = NULL;
2194 char *oidc_directory = NULL;
2195 char *tmp_at = NULL;
2203 "OIDC authorization for token endpoint failed\n");
2218 if (NULL == grant_type)
2248 if (NULL == ego_entry)
2260 if (NULL == code_verifier)
2263 "OAuth authorization request does not contain PKCE parameters!\n");
2276 if (NULL != code_verifier)
2281 if (NULL != code_verifier)
2286 "reclaim-rest-plugin",
2304 "reclaim-rest-plugin",
2305 "oidc_json_web_algorithm",
2309 "Could not read OIDC JSON Web Algorithm config attribute."
2310 "Defaulting to RS256.");
2331 (
"Failed to create directory `%s' for storing oidc data\n"),
2346 (NULL != nonce) ? nonce : NULL,
2353 "reclaim-rest-plugin",
2374 (NULL != nonce) ? nonce : NULL,
2392 strlen (access_token),
2414 "OIDC access token already issued. Cleanup.\n");
2428 "Pragma",
"no-cache"));
2431 "application/json"));
2454 struct MHD_Response *resp;
2459 if (NULL !=
handle->consume_timeout_op)
2461 handle->consume_timeout_op = NULL;
2468 strlen (
handle->access_token),
2472 if (NULL != cached_code)
2485 handle->attr_userinfo_list,
2504 handle->attr_userinfo_list->list_tail,
2506 if (NULL == presentation)
2508 for (atle =
handle->presentations->list_head;
2509 NULL != atle; atle = atle->
next)
2527 handle->presentations->list_tail,
2541 struct MHD_Response *resp;
2547 handle->consume_timeout_op = NULL;
2548 if (NULL !=
handle->idp_op)
2553 "Ticket consumptioned timed out. Using cache...\n");
2555 strlen (
handle->access_token),
2559 if (NULL == cached_code)
2577 cached_code, NULL, &
ticket,
2622 char delimiter[] =
" ";
2624 char *authorization;
2625 char *authorization_type;
2626 char *authorization_access_token;
2650 authorization_type = strtok (authorization, delimiter);
2651 if ((NULL == authorization_type) ||
2652 (0 != strcmp (
"Bearer", authorization_type)))
2661 authorization_access_token = strtok (NULL, delimiter);
2662 if (NULL == authorization_access_token)
2687 if (NULL == aud_ego)
2698 handle->attr_userinfo_list =
2729 char *oidc_directory;
2730 char *oidc_jwk_path;
2731 char *oidc_jwk_pub_str;
2733 struct MHD_Response *resp;
2750 (
"Failed to create directory `%s' for storing oidc data\n"),
2763 oidc_jwk_pub_str = json_dumps (
oidc_jwk, JSON_INDENT (1));
2809 const char *identifier)
2825 ego_entry->
ego = ego;
2833 if (identifier != NULL)
2835 for (ego_entry =
ego_head; NULL != ego_entry;
2836 ego_entry = ego_entry->
next)
2838 if (ego_entry->
ego == ego)
2846 if (NULL == ego_entry)
2852 ego_entry->
ego = ego;
2862 for (ego_entry =
ego_head; NULL != ego_entry;
2863 ego_entry = ego_entry->
next)
2865 if (ego_entry->
ego == ego)
2868 if (NULL == ego_entry)
2887 json_t *oidc_config;
2888 json_t *auth_methods;
2891 json_t *response_types;
2893 json_t *claim_types;
2894 char *oidc_config_str;
2895 struct MHD_Response *resp;
2898 oidc_config = json_object ();
2900 json_object_set_new (oidc_config,
2901 "issuer", json_string (
"http://localhost:7776"));
2902 json_object_set_new (oidc_config,
2903 "authorization_endpoint",
2904 json_string (
"https://api.reclaim/openid/authorize"));
2905 json_object_set_new (oidc_config,
2907 json_string (
"http://localhost:7776/openid/token"));
2908 auth_methods = json_array ();
2909 json_array_append_new (auth_methods,
2910 json_string (
"client_secret_basic"));
2911 json_array_append_new (auth_methods,
2912 json_string (
"client_secret_post"));
2913 json_object_set_new (oidc_config,
2914 "token_endpoint_auth_methods_supported",
2916 sig_algs = json_array ();
2917 json_array_append_new (sig_algs,
2918 json_string (
"HS512"));
2919 json_array_append_new (sig_algs,
2920 json_string (
"RS256"));
2921 json_object_set_new (oidc_config,
2922 "id_token_signing_alg_values_supported",
2924 json_object_set_new (oidc_config,
2926 json_string (
"http://localhost:7776/jwks.json"));
2927 json_object_set_new (oidc_config,
2928 "userinfo_endpoint",
2929 json_string (
"http://localhost:7776/openid/userinfo"));
2930 scopes = json_array ();
2931 json_array_append_new (scopes,
2932 json_string (
"openid"));
2933 json_array_append_new (scopes,
2934 json_string (
"profile"));
2935 json_array_append_new (scopes,
2936 json_string (
"email"));
2937 json_array_append_new (scopes,
2938 json_string (
"address"));
2939 json_array_append_new (scopes,
2940 json_string (
"phone"));
2941 json_object_set_new (oidc_config,
2944 response_types = json_array ();
2945 json_array_append_new (response_types,
2946 json_string (
"code"));
2947 json_object_set_new (oidc_config,
2948 "response_types_supported",
2950 sub_types = json_array ();
2951 json_array_append_new (sub_types,
2952 json_string (
"public"));
2953 json_object_set_new (oidc_config,
2954 "subject_types_supported",
2956 claim_types = json_array ();
2957 json_array_append_new (claim_types,
2958 json_string (
"normal"));
2959 json_array_append_new (claim_types,
2960 json_string (
"aggregated"));
2961 json_object_set_new (oidc_config,
2962 "claim_types_supported",
2964 json_object_set_new (oidc_config,
2965 "claims_parameter_supported",
2967 oidc_config_str = json_dumps (oidc_config, JSON_INDENT (1));
2970 json_decref (oidc_config);
2988 struct MHD_Response *resp;
2994 MHD_add_response_header (resp,
2995 "Access-Control-Allow-Methods",
2998 MHD_add_response_header (resp,
2999 "Access-Control-Allow-Origin",
3017 { MHD_HTTP_METHOD_POST,
3039 handle->response_code = 0;
3041 handle->proc_cls = proc_cls;
3043 handle->rest_handle = rest_handle;
3084 "reclaim-rest-plugin",
3085 "OIDC_USERINFO_CONSUME_TIMEOUT",
3094 "%s, %s, %s, %s, %s",
3095 MHD_HTTP_METHOD_GET,
3096 MHD_HTTP_METHOD_POST,
3097 MHD_HTTP_METHOD_PUT,
3098 MHD_HTTP_METHOD_DELETE,
3099 MHD_HTTP_METHOD_OPTIONS);
3102 _ (
"OpenID Connect REST API initialized\n"));
3153 while (NULL != (ego_entry =
ego_head))
3164 "OpenID Connect REST plugin is finished\n");
struct GNUNET_MQ_MessageHandlers handlers[]
static int ret
Final status code.
struct TestcasePlugin * plugin
The process handle to the testbed service.
static char * data
The data to insert into the dht.
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_FS_Handle * ctx
struct GNUNET_CRYPTO_PrivateKey pk
Private key from command line option, or NULL.
static char * pkey
Public key of the zone to look in, in ASCII.
static struct GNUNET_CRYPTO_PublicKey pubkey
Public key of the zone to look in.
static unsigned int rd_count
Number of records for currently parsed set.
static char * res
Currently read line or NULL on EOF.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
static char * value
Value of the record to add/remove.
static size_t data_size
Number of bytes in data.
static struct GNUNET_IDENTITY_Handle * identity
Which namespace do we publish to? NULL if we do not publish to a namespace.
static char * attr_name
The attribute.
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
static struct GNUNET_RECLAIM_Identifier credential
Credential ID.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
API that can be used to manipulate GNS record data.
Identity service; implements identity management for GNUnet.
API that can be used to store naming information on a GNUnet node;.
Identity attribute definitions.
reclaim service; implements identity and personal data sharing for GNUnet
API for helper library to parse/create REST.
GNUnet service REST plugin header.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be the name of a file or directory.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time)
Get a configuration value that should be a relative time.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
void GNUNET_CONFIGURATION_iterate_section_values(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, GNUNET_CONFIGURATION_Iterator iter, void *iter_cls)
Iterate over values of a section in the configuration.
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_create(const char *dir)
Implementation of "mkdir -p".
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
void GNUNET_GNS_disconnect(struct GNUNET_GNS_Handle *handle)
Shutdown connection with the GNS service.
struct GNUNET_GNS_LookupRequest * GNUNET_GNS_lookup(struct GNUNET_GNS_Handle *handle, const char *name, const struct GNUNET_CRYPTO_PublicKey *zone, uint32_t type, enum GNUNET_GNS_LocalOptions options, GNUNET_GNS_LookupResultProcessor proc, void *proc_cls)
Perform an asynchronous lookup operation on the GNS.
void * GNUNET_GNS_lookup_cancel(struct GNUNET_GNS_LookupRequest *lr)
Cancel pending lookup request.
struct GNUNET_GNS_Handle * GNUNET_GNS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize the connection with the GNS service.
@ GNUNET_GNS_LO_DEFAULT
Defaults, look in cache, then in DHT.
#define GNUNET_GNS_EMPTY_LABEL_AT
String we use to indicate an empty label (top-level entry in the zone).
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL).
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE
If a value with the given key exists, replace it.
const struct GNUNET_CRYPTO_PrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
struct GNUNET_IDENTITY_Handle * GNUNET_IDENTITY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_IDENTITY_Callback cb, void *cb_cls)
Connect to the identity service.
void GNUNET_IDENTITY_disconnect(struct GNUNET_IDENTITY_Handle *h)
Disconnect from identity service.
void GNUNET_IDENTITY_ego_get_public_key(struct GNUNET_IDENTITY_Ego *ego, struct GNUNET_CRYPTO_PublicKey *pk)
Get the identifier (public key) of an ego.
#define GNUNET_log(kind,...)
char * GNUNET_buffer_reap_str(struct GNUNET_Buffer *buf)
Clear the buffer and return the string it contained.
char * GNUNET_CRYPTO_public_key_to_string(const struct GNUNET_CRYPTO_PublicKey *key)
Creates a (Base32) string representation of the public key.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_key_get_public(const struct GNUNET_CRYPTO_PrivateKey *privkey, struct GNUNET_CRYPTO_PublicKey *key)
Retrieves the public key representation of a private key.
void GNUNET_buffer_write_fstr(struct GNUNET_Buffer *buf, const char *fmt,...) __attribute__((format(printf
Write a 0-terminated formatted string to a buffer, excluding the 0-terminator.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
void GNUNET_buffer_write_str(struct GNUNET_Buffer *buf, const char *str)
Write a 0-terminated string to a buffer, excluding the 0-terminator.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_public_key_from_string(const char *str, struct GNUNET_CRYPTO_PublicKey *key)
Parses a (Base32) string representation of the public key.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_strndup(a, length)
Wrapper around GNUNET_xstrndup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_RECLAIM_id_is_equal(a, b)
struct GNUNET_RECLAIM_Presentation * GNUNET_RECLAIM_presentation_new(uint32_t type, const void *data, size_t data_size)
void GNUNET_RECLAIM_attribute_list_destroy(struct GNUNET_RECLAIM_AttributeList *attrs)
Destroy claim list.
void GNUNET_RECLAIM_credential_list_destroy(struct GNUNET_RECLAIM_CredentialList *credentials)
Destroy credential list.
void GNUNET_RECLAIM_presentation_list_destroy(struct GNUNET_RECLAIM_PresentationList *presentations)
Destroy presentations list.
struct GNUNET_RECLAIM_Attribute * GNUNET_RECLAIM_attribute_new(const char *attr_name, const struct GNUNET_RECLAIM_Identifier *credential, uint32_t type, const void *data, size_t data_size)
Create a new attribute claim.
struct GNUNET_RECLAIM_Credential * GNUNET_RECLAIM_credential_new(const char *name, uint32_t type, const void *data, size_t data_size)
Create a new credential.
void GNUNET_RECLAIM_disconnect(struct GNUNET_RECLAIM_Handle *h)
Disconnect from identity provider service.
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_issue(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *iss, const struct GNUNET_CRYPTO_PublicKey *rp, const struct GNUNET_RECLAIM_AttributeList *attrs, GNUNET_RECLAIM_IssueTicketCallback cb, void *cb_cls)
Issues a ticket to a relying party.
void GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op)
Cancel an identity provider operation.
void GNUNET_RECLAIM_get_attributes_stop(struct GNUNET_RECLAIM_AttributeIterator *it)
Stops iteration and releases the handle for further calls.
void GNUNET_RECLAIM_get_credentials_next(struct GNUNET_RECLAIM_CredentialIterator *ait)
Calls the record processor specified in GNUNET_RECLAIM_get_credentials_start for the next record.
struct GNUNET_RECLAIM_AttributeIterator * GNUNET_RECLAIM_get_attributes_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_AttributeResult proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
List all attributes for a local identity.
void GNUNET_RECLAIM_get_attributes_next(struct GNUNET_RECLAIM_AttributeIterator *it)
Calls the record processor specified in GNUNET_RECLAIM_get_attributes_start for the next record.
struct GNUNET_RECLAIM_Operation * GNUNET_RECLAIM_ticket_consume(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *identity, const struct GNUNET_RECLAIM_Ticket *ticket, GNUNET_RECLAIM_AttributeTicketResult cb, void *cb_cls)
Consumes an issued ticket.
struct GNUNET_RECLAIM_Handle * GNUNET_RECLAIM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the re:claimID service.
void GNUNET_RECLAIM_get_credentials_stop(struct GNUNET_RECLAIM_CredentialIterator *ait)
Stops iteration and releases the handle for further calls.
void GNUNET_RECLAIM_ticket_iteration_stop(struct GNUNET_RECLAIM_TicketIterator *it)
Stops iteration and releases the handle for further calls.
struct GNUNET_RECLAIM_CredentialIterator * GNUNET_RECLAIM_get_credentials_start(struct GNUNET_RECLAIM_Handle *h, const struct GNUNET_CRYPTO_PrivateKey *identity, GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, GNUNET_RECLAIM_CredentialResult proc, void *proc_cls, GNUNET_SCHEDULER_TaskCallback finish_cb, void *finish_cb_cls)
List all credentials for a local identity.
int GNUNET_REST_handle_request(struct GNUNET_REST_RequestHandle *conn, const struct GNUNET_REST_RequestHandler *handlers, struct GNUNET_REST_RequestHandlerError *err, void *cls)
void(* GNUNET_REST_ResultProcessor)(void *cls, struct MHD_Response *resp, int status)
Iterator called on obtained result for a REST result.
#define GNUNET_REST_HANDLER_END
struct MHD_Response * GNUNET_REST_create_response(const char *data)
Create REST MHD response.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
size_t GNUNET_STRINGS_urlencode(size_t len, const char data[static len], char **out)
url/percent encode (RFC3986).
char * GNUNET_STRINGS_data_to_string_alloc(const void *buf, size_t size)
Return the base32crockford encoding of the given buffer.
size_t GNUNET_STRINGS_urldecode(const char *data, size_t len, char **out)
url/percent encode (RFC3986).
enum GNUNET_GenericReturnValue GNUNET_STRINGS_string_to_data(const char *enc, size_t enclen, void *out, size_t out_size)
Convert CrockfordBase32 encoding back to data.
size_t GNUNET_STRINGS_base64_decode(const char *data, size_t len, void **output)
Decode from Base64.
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_second_(void)
Return relative time of 1s.
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
@ MHD_HTTP_BAD_REQUEST
Bad Request [RFC7231, Section 6.5.1].
@ MHD_HTTP_UNAUTHORIZED
Unauthorized [RFC7235, Section 3.1].
@ MHD_HTTP_OK
OK [RFC7231, Section 6.3.1].
@ MHD_HTTP_INTERNAL_SERVER_ERROR
Internal Server Error [RFC7231, Section 6.6.1].
@ MHD_HTTP_FOUND
Found [RFC7231, Section 6.4.3].
char * OIDC_generate_userinfo(const struct GNUNET_CRYPTO_PublicKey *sub_key, const struct GNUNET_RECLAIM_AttributeList *attrs, const struct GNUNET_RECLAIM_PresentationList *presentations)
Generate userinfo JSON as string.
char * OIDC_generate_id_token_rsa(const struct GNUNET_CRYPTO_PublicKey *aud_key, const struct GNUNET_CRYPTO_PublicKey *sub_key, const struct GNUNET_RECLAIM_AttributeList *attrs, const struct GNUNET_RECLAIM_PresentationList *presentations, const struct GNUNET_TIME_Relative *expiration_time, const char *nonce, const json_t *secret_rsa_key)
Create a JWT using RSA256 algorithm from attributes.
char * OIDC_build_authz_code(const struct GNUNET_CRYPTO_PrivateKey *issuer, const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_RECLAIM_AttributeList *attrs, const struct GNUNET_RECLAIM_PresentationList *presentations, const char *nonce_str, const char *code_challenge)
Builds an OIDC authorization code including a reclaim ticket and nonce.
char * OIDC_generate_id_token_hmac(const struct GNUNET_CRYPTO_PublicKey *aud_key, const struct GNUNET_CRYPTO_PublicKey *sub_key, const struct GNUNET_RECLAIM_AttributeList *attrs, const struct GNUNET_RECLAIM_PresentationList *presentations, const struct GNUNET_TIME_Relative *expiration_time, const char *nonce, const char *secret_key)
Create a JWT using HMAC (HS256) from attributes.
char * OIDC_access_token_new(const struct GNUNET_RECLAIM_Ticket *ticket)
Generate a new access token.
enum GNUNET_GenericReturnValue OIDC_check_scopes_for_claim_request(const char *scopes, const char *attr)
Checks if a claim is implicitly requested through standard scope(s) or explicitly through non-standar...
void OIDC_build_token_response(const char *access_token, const char *id_token, const struct GNUNET_TIME_Relative *expiration_time, char **token_response)
Build a token response for a token request TODO: Maybe we should add the scope here?
int OIDC_parse_authz_code(const struct GNUNET_CRYPTO_PublicKey *audience, const char *code, const char *code_verifier, struct GNUNET_RECLAIM_Ticket *ticket, struct GNUNET_RECLAIM_AttributeList **attrs, struct GNUNET_RECLAIM_PresentationList **presentations, char **nonce_str, enum OIDC_VerificationOptions opts)
Parse reclaim ticket and nonce from authorization code.
int OIDC_access_token_parse(const char *token, struct GNUNET_RECLAIM_Ticket **ticket)
Parse an access token.
#define JWT_ALG_VALUE_RSA
@ OIDC_VERIFICATION_NO_CODE_VERIFIER
Do not check code verifier even if expected.
@ OIDC_VERIFICATION_DEFAULT
Strict verification.
#define JWT_ALG_VALUE_HMAC
static struct EgoEntry * ego_tail
Ego list.
#define OIDC_SCOPE_KEY
OIDC scope key.
static void consume_fail(void *cls)
static int attr_in_userinfo_request(struct RequestHandle *handle, const char *attr_name)
#define OIDC_AUTHORIZATION_HEADER_KEY
OIDC cookie header information key.
#define GNUNET_REST_API_NS_OIDC_CONFIG
OIDC config.
json_t * read_jwk_from_file(const char *filename)
Read the the JSON Web Key in the given file and return it.
static struct GNUNET_RECLAIM_Handle * idp
Identity Provider.
struct GNUNET_CONTAINER_MultiHashMap * oidc_code_cache
OIDC hashmap for cached access tokens and codes.
static void cookie_identity_interpretation(struct RequestHandle *handle)
Interprets cookie header and pass its identity keystring to handle.
static struct GNUNET_GNS_Handle * gns_handle
GNS handle.
static int write_jwk_to_file(const char *filename, json_t *jwk)
Write the JWK to file.
#define OIDC_ERROR_KEY_INVALID_REQUEST
OIDC error key for invalid requests.
const struct EgoEntry * find_ego(struct RequestHandle *handle, struct GNUNET_CRYPTO_PublicKey *test_key)
static int attr_in_claims_request(struct RequestHandle *handle, const char *attr_name, const char *claims_parameter)
static char * get_url_parameter_copy(const struct RequestHandle *handle, const char *key)
#define GNUNET_REST_API_NS_LOGIN
Login namespace.
#define OIDC_ERROR_KEY_UNAUTHORIZED_CLIENT
OIDC error key for unauthorized clients.
#define GNUNET_REST_API_NS_OIDC
REST root namespace.
static char * OIDC_ignored_parameter_array[]
OIDC ignored parameter array.
static void do_timeout(void *cls)
Task run on timeout, sends error message.
static int parse_credentials_post_body(struct RequestHandle *handle, char **client_id, char **client_secret)
static void token_endpoint(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Responds to token url-encoded POST request.
static void userinfo_endpoint(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Responds to userinfo GET and url-encoded POST request.
static void jwks_endpoint(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Responds to /jwks.json.
#define OIDC_ERROR_KEY_UNSUPPORTED_GRANT_TYPE
OIDC error key for unsupported grants.
#define OIDC_ERROR_KEY_INVALID_TOKEN
OIDC error key for invalid tokens.
static struct GNUNET_TIME_Relative consume_timeout
Timeout for consume call on userinfo.
static void oidc_attr_collect(void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr)
Collects all attributes for an ego if in scope parameter.
#define OIDC_CLAIMS_KEY
OIDC claims key.
char * get_oidc_jwk_path(void *cls)
Return the path to the RSA JWK key file.
struct GNUNET_CONTAINER_MultiHashMap * OIDC_cookie_jar_map
OIDC hashmap that keeps track of issued cookies.
#define OIDC_ERROR_KEY_SERVER_ERROR
OIDC error key for generic server errors.
#define OIDC_COOKIE_EXPIRATION
OIDC cookie expiration (in seconds)
#define OIDC_ERROR_KEY_ACCESS_DENIED
OIDC error key for denied access.
static void login_cont(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Combines an identity with a login time and responds OK to login request.
static void oidc_cred_collect(void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Credential *cred)
Collects all attributes for an ego if in scope parameter.
#define OIDC_COOKIE_HEADER_KEY
OIDC cookie header key.
enum GNUNET_GenericReturnValue REST_openid_process_request(void *plugin, struct GNUNET_REST_RequestHandle *rest_handle, GNUNET_REST_ResultProcessor proc, void *proc_cls)
Function processing the REST call.
#define GNUNET_REST_API_JWKS
JSON Web Keys endpoint.
void * REST_openid_init(const struct GNUNET_CONFIGURATION_Handle *c)
Entry point for the plugin.
#define OIDC_JWK_RSA_FILENAME
OIDC key store file name.
#define ID_REST_STATE_INIT
State while collecting all egos.
#define OIDC_REDIRECT_URI_KEY
OIDC redirect_uri key.
static void do_redirect_error(void *cls)
Task run on error, sends error message and redirects.
static void code_redirect(void *cls)
Checks time and cookie and redirects accordingly.
static struct RequestHandle * requests_head
DLL.
static void options_cont(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Respond to OPTIONS request.
#define OIDC_NONCE_KEY
OIDC nonce key.
#define OIDC_ERROR_KEY_INVALID_CLIENT
OIDC error key for invalid client.
static int parse_credentials_basic_auth(struct RequestHandle *handle, char **client_id, char **client_secret)
#define OIDC_GRANT_TYPE_KEY
OIDC grant_type key.
static int state
The processing state.
#define OIDC_ERROR_KEY_INVALID_COOKIE
OIDC error key for invalid cookies.
static struct EgoEntry * ego_head
Ego list.
static void list_ego(void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *identifier)
If listing is enabled, prints information about the egos.
static void oidc_cred_collect_finished_cb(void *cls)
#define OIDC_CODE_CHALLENGE_KEY
OIDC PKCE code challenge.
static char * allow_methods
HTTP methods allows for this plugin.
static void oidc_config_endpoint(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
static void cleanup_handle(struct RequestHandle *handle)
Cleanup lookup handle.
const struct GNUNET_CONFIGURATION_Handle * oid_cfg
The configuration handle.
char * get_oidc_dir_path(void *cls)
Return the path to the oidc directory path.
#define OIDC_COOKIE_HEADER_ACCESS_DENIED
OIDC cookie header if user cancelled.
#define GNUNET_REST_API_NS_TOKEN
Token endpoint.
#define CONSUME_TIMEOUT
How long to wait for a consume in userinfo endpoint.
#define OIDC_EXPECTED_AUTHORIZATION_SCOPE
OIDC expected scope part while authorizing.
static void build_authz_response(void *cls)
Iteration over all results finished, build final response.
static void do_userinfo_error(void *cls)
Task run on error in userinfo endpoint, sends error header.
static void oidc_ticket_issue_cb(void *cls, const struct GNUNET_RECLAIM_Ticket *ticket, const struct GNUNET_RECLAIM_PresentationList *presentation)
Issues ticket and redirects to relying party with the authorization code as parameter.
#define OIDC_RESPONSE_TYPE_KEY
OIDC response_type key.
static void consume_ticket(void *cls, const struct GNUNET_CRYPTO_PublicKey *identity, const struct GNUNET_RECLAIM_Attribute *attr, const struct GNUNET_RECLAIM_Presentation *presentation)
Collects claims and stores them in handle.
static struct RequestHandle * requests_tail
DLL.
#define OIDC_COOKIE_HEADER_INFORMATION_KEY
OIDC cookie header information key.
static struct GNUNET_RECLAIM_AttributeList * attribute_list_merge(struct GNUNET_RECLAIM_AttributeList *list_a, struct GNUNET_RECLAIM_AttributeList *list_b)
#define OIDC_STATE_KEY
OIDC state key.
static struct GNUNET_IDENTITY_Handle * identity_handle
Handle to Identity service.
static void tld_iter(void *cls, const char *section, const char *option, const char *value)
Iterate over tlds in config.
static int check_authorization(struct RequestHandle *handle, struct GNUNET_CRYPTO_PublicKey *cid)
#define OIDC_EXPECTED_AUTHORIZATION_RESPONSE_TYPE
OIDC expected response_type while authorizing.
#define GNUNET_REST_API_NS_USERINFO
UserInfo endpoint.
void * REST_openid_done(void *cls)
Exit point from the plugin.
#define GNUNET_REST_API_NS_AUTHORIZE
Authorize endpoint.
static void oidc_config_cors(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Respond to OPTIONS request.
#define OIDC_CODE_KEY
OIDC code key.
#define OIDC_CODE_VERIFIER_KEY
OIDC PKCE code verifier.
static void authorize_endpoint(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Responds to authorization GET and url-encoded POST request.
#define OIDC_CLIENT_ID_KEY
OIDC client_id key.
#define OIDC_GRANT_TYPE_VALUE
OIDC grant_type key.
json_t * oidc_jwk
The RSA key used by the oidc enpoint.
#define ID_REST_STATE_POST_INIT
Done collecting egos.
static int cleanup_hashmap(void *cls, const struct GNUNET_HashCode *key, void *value)
static void lookup_redirect_uri_result(void *cls, uint32_t rd_count, const struct GNUNET_GNSRECORD_Data *rd)
static void build_redirect(void *cls)
static void oidc_attr_collect_finished_cb(void *cls)
json_t * generate_jwk()
Generate a new RSA JSON Web Key.
#define OIDC_ERROR_KEY_UNSUPPORTED_RESPONSE_TYPE
OIDC error key for unsupported response types.
#define OIDC_ERROR_KEY_INVALID_SCOPE
OIDC error key for invalid scopes.
static void do_error(void *cls)
Task run on error, sends error message.
static void oidc_iteration_error(void *cls)
Does internal server error when iteration failed.
static void client_redirect(void *cls)
Initiate redirect back to client.
static void login_redirect(void *cls)
Redirects to login page stored in configuration file.
static int attr_in_idtoken_request(struct RequestHandle *handle, const char *attr_name)
#define GNUNET_GNSRECORD_TYPE_RECLAIM_OIDC_REDIRECT
Used reclaimID OIDC client redirect URIs.
The default namestore ego.
char * identifier
Ego Identifier.
struct EgoEntry * prev
DLL.
char * keystring
Public key string.
struct EgoEntry * next
DLL.
struct GNUNET_IDENTITY_Ego * ego
The Ego.
void * cls
Closure for all of the callbacks.
Dynamically growing buffer.
Internal representation of the hash map.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
size_t data_size
Number of bytes in data.
Connection to the GNS service.
Handle to a lookup request.
Handle for an operation with the identity service.
Handle for a attribute iterator operation.
struct GNUNET_RECLAIM_Attribute * attribute
The attribute claim.
struct GNUNET_RECLAIM_AttributeListEntry * next
DLL.
A list of GNUNET_RECLAIM_Attribute structures.
struct GNUNET_RECLAIM_AttributeListEntry * list_tail
List tail.
struct GNUNET_RECLAIM_AttributeListEntry * list_head
List head.
const char * name
The name of the attribute.
struct GNUNET_RECLAIM_Identifier credential
Referenced ID of credential (may be GNUNET_RECLAIM_ID_ZERO if self-creded)
struct GNUNET_RECLAIM_Identifier id
ID.
uint32_t type
Type of Claim.
const void * data
Binary value stored as attribute value.
size_t data_size
Number of bytes in data.
Handle for a credential iterator operation.
struct GNUNET_RECLAIM_CredentialListEntry * next
DLL.
struct GNUNET_RECLAIM_Credential * credential
The credential.
A list of GNUNET_RECLAIM_Credential structures.
uint32_t type
Type/Format of Claim.
const char * name
The name of the credential.
const void * data
Binary value stored as credential value.
size_t data_size
Number of bytes in data.
struct GNUNET_RECLAIM_Identifier id
ID.
Handle for an operation with the service.
struct GNUNET_RECLAIM_Presentation * presentation
The credential.
struct GNUNET_RECLAIM_PresentationListEntry * next
DLL.
A list of GNUNET_RECLAIM_Presentation structures.
A credential presentation.
const void * data
Binary value stored as presentation value.
uint32_t type
Type/Format of Claim.
struct GNUNET_RECLAIM_Identifier credential_id
The credential id of which this is a presentation.
Handle for a ticket iterator operation.
The authorization ticket.
struct GNUNET_CRYPTO_PublicKey audience
The ticket audience (= relying party)
struct GNUNET_CRYPTO_PublicKey identity
The ticket issuer (= the user)
struct returned by the initialization function of the plugin
void * cls
The closure of the plugin.
const char * url
The url as string.
void(* proc)(struct GNUNET_REST_RequestHandle *handle, const char *url, void *cls)
Namespace to handle.
Entry in list of pending tasks.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
Time for relative time used by GNUnet, in microseconds.
char * login_identity
The identity chosen by the user to login.
char * client_id
The OIDC client id of the RP.
char * response_type
The OIDC response type.
int user_cancelled
User cancelled authorization/login.
char * redirect_uri
The OIDC redirect uri.
char * claims
The OIDC claims.
char * code_challenge
The PKCE code_challenge.
struct GNUNET_CRYPTO_PublicKey client_pkey
The RP client public key.
char * scope
The list of oidc scopes.
char * code_verifier
The PKCE code_verifier.
char * nonce
The OIDC nonce.
char * state
The OIDC state.
struct GNUNET_BLOCK_PluginFunctions * api
Plugin API.
const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
struct GNUNET_RECLAIM_TicketIterator * ticket_it
Ticket iterator.
struct GNUNET_RECLAIM_Ticket ticket
A ticket.
char * emsg
Error response message.
struct GNUNET_IDENTITY_Operation * op
IDENTITY Operation.
struct RequestHandle * prev
DLL.
struct GNUNET_RECLAIM_PresentationList * presentations
Presentations.
struct GNUNET_RECLAIM_Operation * idp_op
Idp Operation.
struct GNUNET_RECLAIM_AttributeList * attr_idtoken_list
Attribute claim list for id_token.
int response_code
HTTP response code.
struct EgoEntry * ego_entry
IDENTITY Operation.
struct GNUNET_SCHEDULER_Task * timeout_task
ID of a task associated with the resolution process.
struct GNUNET_CRYPTO_PrivateKey priv_key
Pointer to ego private key.
void * proc_cls
The closure of the result processor.
char * access_token
The passed access token.
char * redirect_prefix
The redirect prefix.
struct GNUNET_RECLAIM_AttributeIterator * attr_it
Attribute iterator.
GNUNET_REST_ResultProcessor proc
The plugin result processor.
char * redirect_suffix
The redirect suffix.
struct RequestHandle * next
DLL.
struct GNUNET_RECLAIM_CredentialIterator * cred_it
Credential iterator.
struct GNUNET_REST_RequestHandle * rest_handle
Handle to rest request.
int public_client
Public client.
char * tld
The tld for redirect.
struct OIDC_Variables * oidc
OIDC variables.
struct GNUNET_RECLAIM_AttributeList * attr_userinfo_list
Attribute claim list for userinfo.
struct GNUNET_GNS_LookupRequest * gns_op
GNS lookup op.
struct GNUNET_RECLAIM_CredentialList * credentials
Credentials.
struct GNUNET_SCHEDULER_Task * consume_timeout_op
Timeout task for consume.
struct GNUNET_TIME_Relative timeout
Desired timeout for the lookup (default is no timeout).
char * edesc
Error response description.