MCPcopy
hub / github.com/simov/grant / verify

Function verify

test/handler/oidc.js:43–63  ·  view source on GitHub ↗
({form, alg})

Source from the content-addressed store, hash-verified

41 })
42
43 var verify = ({form, alg}) => {
44 t.equal(form.grant_type, 'authorization_code')
45 t.equal(form.code, 'code')
46 t.equal(form.redirect_uri, 'http://localhost:5001/connect/oauth2/callback')
47 t.equal(form.client_assertion_type, 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer')
48
49 var jwt = oidc.jwt(form.client_assertion)
50 t.ok(jws.verify(form.client_assertion, jwt.header.alg, keys[alg].public_pem))
51
52 t.equal(jwt.header.typ, 'JWT')
53 t.equal(jwt.header.alg, alg)
54 t.equal(jwt.payload.iss, 'client_id')
55 t.equal(jwt.payload.iss, jwt.payload.sub)
56 t.equal(jwt.payload.aud, 'http://localhost:5000/oauth2/access_url')
57 t.equal(jwt.payload.jti.length, 40)
58 t.equal(jwt.payload.exp, jwt.payload.iat + 420)
59 t.equal(jwt.payload.iat, jwt.payload.nbf)
60 t.ok(typeof jwt.signature === 'string')
61
62 return jwt
63 }
64
65 var success = ({response}) => {
66 t.deepEqual(response, {

Callers 1

oidc.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…