快递网关jwt发布不工作

时间:2018-05-18 14:57:58

标签: express-gateway

我是EG的新人。我已经遵循了关于发布jwt令牌而不是opaque但仍然接收不透明访问令牌的文档。不确定我想要改变什么。

这是我的system.config文件

Dim MyControl As Control = TableLayoutPanel1.GetControlFromPosition(0, 0)

已经添加了具有自己凭据(oauth2,basic-auth,jwt)的用户和应用程序,而无需更改模型上的任何内容。

这是我的gateway.config文件

db:
  redis:
  host: localhost
  port: 6379
  namespace: EG

crypto:
  cipherKey: sensitiveKey
  algorithm: aes256
  saltRounds: 10
session:
  secret: keyboard cat
  resave: false
  saveUninitialized: false
accessTokens:
  timeToExpiry: 7200000
  tokenType: 'jwt'
  issuer: 'express-gateway'
  audience: 'something'
  subject: 'test'
  secretOrPrivateKey: 'ssssst'
refreshTokens:
  timeToExpiry: 7200000
authorizationCodes:
  timeToExpiry: 300000

登录请求是这样的,秘密是使用应用程序的jwt凭证生成的http: port: 8080 admin: port: 9876 hostname: localhost apiEndpoints: api: host: localhost paths: '/api/*' serviceEndpoints: httpbin: url: 'https://httpbin.org' policies: - jwt - oauth2 - proxy - rate-limit pipelines: default: apiEndpoints: - api policies: - oauth2: action: jwt: issuer: express-gateway audience: something subject: test secretOrPublicKey: ssssst checkCredentialExistence: false - proxy: - action: serviceEndpoint: httpbin changeOrigin: true

http://localhost:8080/oauth2/authorize?response_type=token&client_id=ae921ba9-7b4b-4c53-aaba-354bd6398e52&redirect_uri=http://localhost:3002/explorer&client_secret=0qOpBZkwO2ayQ8dO18yRuh

并且令牌响应看起来像这样。

keySecret

感谢所有能帮助我的人。

1 个答案:

答案 0 :(得分:0)

配置看起来正确。我还亲自尝试了您提供的配置,我找回了JWT

enter image description here

也许您可以尝试在Glitch.me上设置测试项目,以便在本地复制更容易。