apisix-dashboard icon indicating copy to clipboard operation
apisix-dashboard copied to clipboard

request help: invalid secret type (must be string or function)

Open zlchanger opened this issue 6 years ago • 19 comments

Issue description

I used the JWT plug-in for Apisix. The JWT configuration algorithm is HS512, base64_secret: true, and then key and secret are configured, but the call prompts invalid Secret Type (must be string or function), my secret is {^ h1k4&} 2? WN =. This one is a little bit more complicated, it has a lot of special symbols in it, and the last one is' = '. I tried to make secret a little bit simpler, like 1111, but this didn't happen. Why?

Environment

  • apisix version (cmd: apisix version): 1.2
  • OS:

zlchanger avatar Nov 02 '20 08:11 zlchanger

The JWT configuration algorithm is HS512, base64_secret: true, and then key and secret are configured, but the call prompts invalid Secret Type (must be string or function)

I am not quite understand. Could you give us an example about how you call? Like curl xxx -d "blahblah".

spacewander avatar Nov 02 '20 08:11 spacewander

The JWT configuration algorithm is HS512, base64_secret: true, and then key and secret are configured, but the call prompts invalid Secret Type (must be string or function)

I am not quite understand. Could you give us an example about how you call? Like curl xxx -d "blahblah".

详情如下 avatar

avatar

avatar

zlchanger avatar Nov 02 '20 09:11 zlchanger

Look like dashboard's issue? Which version of dashboard you are using?

spacewander avatar Nov 02 '20 10:11 spacewander

Look like dashboard's issue? Which version of dashboard you are using?

自带的吧,我参照你们的docker-example做的,1.2版本的apisix

zlchanger avatar Nov 02 '20 10:11 zlchanger

你们有最新版本的docker-example吗,我直接把版本从1.2改为2.0后,接口请求都变为403了

zlchanger avatar Nov 02 '20 10:11 zlchanger

Please use the dashboard 2.0 RC2 from the v2.0 branch, and it only supports deploying manually. Deploying with Docker is still under development according to this PR[1]

[1] https://github.com/apache/apisix-dashboard/pull/657#pullrequestreview-521510184

juzhiyuan avatar Nov 02 '20 12:11 juzhiyuan

Look like dashboard's issue? Which version of dashboard you are using?

The dashboard you are using is 1.0, but I'm not sure if this error is returned from APISIX or Golang? Could you please have a try on the latest dashboard? This issue may be fixed, or I will have a try on the latest one in 1 week before RC3 releases.

juzhiyuan avatar Nov 02 '20 12:11 juzhiyuan

我打算先把apisix升级到2.0,现在很明显docker内部已经是2.0了,但为什么内部可以访问,外面却访问不了,端口我已经映射出来了,而且config.yaml里面的allow_admin也被我直接注释掉了 avatar

zlchanger avatar Nov 03 '20 02:11 zlchanger

Let's cc @spacewander @Miss-you

juzhiyuan avatar Nov 03 '20 03:11 juzhiyuan

我打算先把apisix升级到2.0,现在很明显docker内部已经是2.0了,但为什么内部可以访问,外面却访问不了,端口我已经映射出来了,而且config.yaml里面的allow_admin也被我直接注释掉了 @zlchanger You should raise a new issue in the APACHE APISIX project.

idbeta avatar Nov 03 '20 03:11 idbeta

You should raise a new issue in the APACHE APISIX project.

OK

zlchanger avatar Nov 03 '20 03:11 zlchanger

Look like dashboard's issue? Which version of dashboard you are using?

The dashboard you are using is 1.0, but I'm not sure if this error is returned from APISIX or Golang? Could you please have a try on the latest dashboard? This issue may be fixed, or I will have a try on the latest one in 1 week before RC3 releases.

我已经把apisix升级到2.0,dashboard也是最新的2.0的,但配上这个jwt还是报错,我尝试将secret改的简单一点,没有特殊符号后,就OK了,但这个secret不是我这边负责的,所以我们的secret暂时没法变动

avatar

zlchanger avatar Nov 03 '20 06:11 zlchanger

还是报错,

Let's check.

juzhiyuan avatar Nov 03 '20 06:11 juzhiyuan

@zlchanger I used docker to install the APISIX dashboard 2.0 version and did not have this “ secret” problem, @nic-chen can you give some advice? image

idbeta avatar Nov 04 '20 04:11 idbeta

Hi @zlchanger, our QA couldn't reproduce this issue, so I have to close this now.

If you could reproduce this & give more detailed steps, welcome to reopen this one, thanks for your report!

juzhiyuan avatar Nov 04 '20 04:11 juzhiyuan

@zlchanger I guess I know why. You select the base64_secret, but your secret {^h1k4&}2?WN= is not in base64 format.

spacewander avatar Nov 06 '20 09:11 spacewander

@zlchanger kindly recheck this issue, if everything works as expected, please close this issue.

juzhiyuan avatar Nov 06 '20 09:11 juzhiyuan

Not sure if this issue gets resolved?

juzhiyuan avatar Nov 10 '20 07:11 juzhiyuan

Consider solved.

spacewander avatar Nov 10 '20 08:11 spacewander