diff options
author | Vivien Kraus <vivien@planete-kraus.eu> | 2021-08-01 14:51:28 +0200 |
---|---|---|
committer | Vivien Kraus <vivien@planete-kraus.eu> | 2021-08-01 18:08:56 +0200 |
commit | bae1843f1a1d644fb3bd4f8c40b1dbb900aa3325 (patch) | |
tree | 00f590033af904a6a493e41bdebe9b3ddd73043b /src/scm/webid-oidc/access-token.scm | |
parent | d8c2ca930673da858d63f2dea9526c259a2dd936 (diff) |
Use guile parameters
With parameters, the API does not need to care about the directory
where to load files and how to get the time.
Diffstat (limited to 'src/scm/webid-oidc/access-token.scm')
-rw-r--r-- | src/scm/webid-oidc/access-token.scm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/scm/webid-oidc/access-token.scm b/src/scm/webid-oidc/access-token.scm index 9c57326..acdc56f 100644 --- a/src/scm/webid-oidc/access-token.scm +++ b/src/scm/webid-oidc/access-token.scm @@ -20,6 +20,7 @@ #:use-module (webid-oidc jwk) #:use-module (webid-oidc oidc-configuration) #:use-module ((webid-oidc stubs) #:prefix stubs:) + #:use-module ((webid-oidc parameters) #:prefix p:) #:use-module (web uri) #:use-module (web client) #:use-module (ice-9 optargs) @@ -206,8 +207,7 @@ (alg #f) (webid #f) (iss #f) - (iat #f) - (exp #f) + (validity 3600) (client-key #f) (cnf/jkt #f) (client-id #f)) @@ -216,6 +216,7 @@ (access-token-encode (make-access-token `((alg . ,(if (symbol? alg) (symbol->string alg) alg))) - (make-access-token-payload - webid iss iat exp cnf/jkt client-id)) + (let ((iat (time-second (date->time-utc ((p:current-date)))))) + (make-access-token-payload + webid iss iat (+ iat validity) cnf/jkt client-id))) issuer-key)) |