GNUnet  0.11.x
oidc_helper.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2010-2015 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
27 #ifndef JWT_H
28 #define JWT_H
29 
30 #define JWT_ALG "alg"
31 
32 /* Use 512bit HMAC */
33 #define JWT_ALG_VALUE "HS512"
34 
35 #define JWT_TYP "typ"
36 
37 #define JWT_TYP_VALUE "jwt"
38 
39 #define SERVER_ADDRESS "https://api.reclaim"
40 
51 char*
52 OIDC_id_token_new (const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
53  const struct GNUNET_CRYPTO_EcdsaPublicKey *sub_key,
54  struct GNUNET_RECLAIM_AttributeList *attrs,
55  struct GNUNET_RECLAIM_AttestationList *attests,
56  const struct GNUNET_TIME_Relative *expiration_time,
57  const char *nonce,
58  const char *secret_key);
59 
71 char*
73  const struct GNUNET_RECLAIM_Ticket *ticket,
74  struct GNUNET_RECLAIM_AttributeList *attrs,
75  struct GNUNET_RECLAIM_AttestationList *attests,
76  const char *nonce,
77  const char *code_challenge);
78 
92 int
94  const char *code,
95  const char *code_verifier,
97  struct GNUNET_RECLAIM_AttributeList **attrs,
98  struct GNUNET_RECLAIM_AttestationList **attests,
99  char **nonce);
100 
110 void
111 OIDC_build_token_response (const char *access_token,
112  const char *id_token,
113  const struct GNUNET_TIME_Relative *expiration_time,
114  char **token_response);
115 
119 char*
121 
122 
123 #endif
The authorization ticket.
uint32_t nonce
The nonce.
Definition: oidc_helper.c:52
char * OIDC_id_token_new(const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key, const struct GNUNET_CRYPTO_EcdsaPublicKey *sub_key, struct GNUNET_RECLAIM_AttributeList *attrs, struct GNUNET_RECLAIM_AttestationList *attests, const struct GNUNET_TIME_Relative *expiration_time, const char *nonce, const char *secret_key)
Create a JWT from attributes.
Definition: oidc_helper.c:124
A list of GNUNET_RECLAIM_Attribute structures.
int OIDC_parse_authz_code(const struct GNUNET_CRYPTO_EcdsaPrivateKey *ecdsa_priv, const char *code, const char *code_verifier, struct GNUNET_RECLAIM_Ticket *ticket, struct GNUNET_RECLAIM_AttributeList **attrs, struct GNUNET_RECLAIM_AttestationList **attests, char **nonce)
Parse reclaim ticket and nonce from authorization code.
Definition: oidc_helper.c:580
A list of GNUNET_RECLAIM_Attestation structures.
Private ECC key encoded for transmission.
static struct GNUNET_RECLAIM_Ticket ticket
Ticket to consume.
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?
Definition: oidc_helper.c:732
char * OIDC_build_authz_code(const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, const struct GNUNET_RECLAIM_Ticket *ticket, struct GNUNET_RECLAIM_AttributeList *attrs, struct GNUNET_RECLAIM_AttestationList *attests, const char *nonce, const char *code_challenge)
Builds an OIDC authorization code including a reclaim ticket and nonce.
Definition: oidc_helper.c:424
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
char * OIDC_access_token_new()
Generate a new access token.
Definition: oidc_helper.c:760
Time for relative time used by GNUnet, in microseconds.