aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2020-08-07 09:25:53 +0200
committerMartin Schanzenbach <mschanzenbach@posteo.de>2020-08-07 09:25:53 +0200
commit05004fd89f45d6e9bc4be81a34d340b1fb522196 (patch)
tree7ad48b687da01130ac3a7a3102da8ed063cad2e3
parent7648cde6cfb181f03df9e145a576430220234f5f (diff)
downloadgnunet-05004fd89f45d6e9bc4be81a34d340b1fb522196.tar.gz
gnunet-05004fd89f45d6e9bc4be81a34d340b1fb522196.zip
-also allow non-standard scopes as claims
-rw-r--r--src/reclaim/oidc_helper.c7
-rw-r--r--src/reclaim/plugin_rest_openid_connect.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c
index d0345108e..eab12db33 100644
--- a/src/reclaim/oidc_helper.c
+++ b/src/reclaim/oidc_helper.c
@@ -769,7 +769,7 @@ OIDC_access_token_parse (const char *token,
769 769
770/** 770/**
771 * Checks if a claim is implicitly requested through standard 771 * Checks if a claim is implicitly requested through standard
772 * scope(s) 772 * scope(s) or explicitly through non-standard scope.
773 * 773 *
774 * @param scopes the scopes which have been requested 774 * @param scopes the scopes which have been requested
775 * @param attr the attribute name to check 775 * @param attr the attribute name to check
@@ -832,6 +832,11 @@ OIDC_check_scopes_for_claim_request (const char*scopes,
832 } 832 }
833 } 833 }
834 834
835 } else if (0 == strcmp (attr, scope_variable))
836 {
837 /** attribute matches requested scope **/
838 GNUNET_free (scope_variables);
839 return GNUNET_YES;
835 } 840 }
836 scope_variable = strtok (NULL, delimiter); 841 scope_variable = strtok (NULL, delimiter);
837 } 842 }
diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c
index 6db494433..2f44917c9 100644
--- a/src/reclaim/plugin_rest_openid_connect.c
+++ b/src/reclaim/plugin_rest_openid_connect.c
@@ -1155,7 +1155,7 @@ attr_in_claims_request (struct RequestHandle *handle,
1155 const char *key; 1155 const char *key;
1156 json_t *value; 1156 json_t *value;
1157 1157
1158 /** Check if attribute is requested through standard scope **/ 1158 /** Check if attribute is requested through a scope **/
1159 if (GNUNET_YES == OIDC_check_scopes_for_claim_request (handle->oidc->scope, 1159 if (GNUNET_YES == OIDC_check_scopes_for_claim_request (handle->oidc->scope,
1160 attr_name)) 1160 attr_name))
1161 return GNUNET_YES; 1161 return GNUNET_YES;