@@ -151,13 +151,13 @@ function jwtverify(txn)
151
151
end
152
152
153
153
-- 5. Verify the issuer
154
- if issuerIsValid (token , issuer ) == false then
154
+ if issuer ~= nil and issuerIsValid (token , issuer ) == false then
155
155
log (" Issuer not valid." )
156
156
goto out
157
157
end
158
158
159
159
-- 6. Verify the audience
160
- if audienceIsValid (token , audience ) == false then
160
+ if audience ~= nil and audienceIsValid (token , audience ) == false then
161
161
log (" Audience not valid." )
162
162
goto out
163
163
end
@@ -166,7 +166,7 @@ function jwtverify(txn)
166
166
if token .payloaddecoded .scope ~= nil then
167
167
txn .set_var (txn , " txn.oauth_scopes" , token .payloaddecoded .scope )
168
168
else
169
- txn .set_var (txn , " txn.oauth_scopes" , " " )
169
+ txn .set_var (txn , " txn.oauth_scopes" , " " )
170
170
end
171
171
172
172
-- 8. Set authorized variable
@@ -192,8 +192,8 @@ core.register_init(function()
192
192
config .audience = os.getenv (" OAUTH_AUDIENCE" )
193
193
194
194
log (" PublicKeyPath: " .. publicKeyPath )
195
- log (" Issuer: " .. config .issuer )
196
- log (" Audience: " .. config .audience )
195
+ log (" Issuer: " .. ( config .issuer or " <none> " ) )
196
+ log (" Audience: " .. ( config .audience or " <none> " ) )
197
197
end )
198
198
199
199
-- Called on a request.
0 commit comments