更改包路径及签名SIGN_KEY,访问接口返回401【请求未授权】

Blade 未结 1 1709
红桃6
红桃6 剑童 2020-04-12 14:33

一、该问题的重现步骤是什么?

1. 更改包路径,如:org.springblade 改为 org.xxcloud

2. SIGN_KEY,由BladeX 改为 XiaoxiangX

3.调用授权接口成功,可以返回access_token

4.【postman】在调用其它接口时,返回错误代码401

5. saber登录界面显示未知错误,与postman返回结果一致


二、你期待的结果是什么?实际看到的又是什么?

1、在生成token时,签名KEY是在哪配置的?

2、当前这种现象,还需要修改什么地方?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

saber、BladeX、BladeTool

2.4.0版本

windows


四、请提供详细的错误堆栈信息,这很重要。

授权成功截图:

image.png


调用其他接口错误信息:

io.jsonwebtoken.SignatureException: JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted.

at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:354)

at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:481)

at io.jsonwebtoken.impl.DefaultJwtParser.parseClaimsJws(DefaultJwtParser.java:541)

at org.xxcloud.core.jwt.JwtUtil.parseJWT(JwtUtil.java:49)

at org.xxcloud.gateway.filter.AuthFilter.filter(AuthFilter.java:54)

at org.springframework.cloud.gateway.handler.FilteringWebHandler$GatewayFilterAdapter.filter(FilteringWebHandler.java:138)

at org.springframework.cloud.gateway.filter.OrderedGatewayFilter.filter(OrderedGatewayFilter.java:44)

at org.springframework.cloud.gateway.handler.FilteringWebHandler$DefaultGatewayFilterChain.lambda$filter$0(FilteringWebHandler.java:118)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:44)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)

at reactor.core.publisher.MonoDoFinally.subscribe(MonoDoFinally.java:47)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)

at reactor.core.publisher.Mono.subscribe(Mono.java:3877)

at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:172)

at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)

at reactor.core.publisher.Mono.subscribe(Mono.java:3877)

at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:172)

at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)

at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150)

at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)

at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76)

at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.innerNext(FluxConcatMap.java:275)

at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:849)

at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)

at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)

at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1555)

at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:144)

at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)

at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76)

at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.innerNext(FluxConcatMap.java:275)

at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:849)

at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:73)

at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192)

at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1555)

at reactor.core.publisher.MonoFilterWhen$MonoFilterWhenMain.onNext(MonoFilterWhen.java:140)

at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2117)

at reactor.core.publisher.MonoFilterWhen$MonoFilterWhenMain.onSubscribe(MonoFilterWhen.java:103)

at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)

at reactor.core.publisher.MonoFilterWhen.subscribe(MonoFilterWhen.java:56)

at reactor.core.publisher.MonoPeek.subscribe(MonoPeek.java:71)

at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)

at reactor.core.publisher.Mono.subscribe(Mono.java:3877)

at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:442)

at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onNext(FluxConcatMap.java:244)

at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onNext(FluxDematerialize.java:114)

at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onNext(FluxDematerialize.java:42)

at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:243)

at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:201)

at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.request(FluxDematerialize.java:157)

at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onSubscribe(FluxConcatMap.java:229)

at reactor.core.publisher.FluxDematerialize$DematerializeSubscriber.onSubscribe(FluxDematerialize.java:88)

at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:139)

at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:63)

at reactor.core.publisher.FluxDematerialize.subscribe(FluxDematerialize.java:39)

at reactor.core.publisher.FluxDefer.subscribe(FluxDefer.java:54)

at reactor.core.publisher.FluxConcatMap.subscribe(FluxConcatMap.java:121)

at reactor.core.publisher.MonoNext.subscribe(MonoNext.java:40)

at reactor.core.publisher.MonoMap.subscribe(MonoMap.java:55)

at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)

at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44)

at reactor.core.publisher.MonoMap.subscribe(MonoMap.java:55)

at reactor.core.publisher.Mono.subscribe(Mono.java:3877)

at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:442)

at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onSubscribe(FluxConcatMap.java:212)

at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:139)

at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:63)

at reactor.core.publisher.FluxConcatMap.subscribe(FluxConcatMap.java:121)

at reactor.core.publisher.MonoNext.subscribe(MonoNext.java:40)

at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44)

at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)

at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)

at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150)

at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1555)

at reactor.core.publisher.MonoZip$ZipCoordinator.signal(MonoZip.java:247)

at reactor.core.publisher.MonoZip$ZipInner.onNext(MonoZip.java:329)

at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2117)

at reactor.core.publisher.MonoZip$ZipInner.onSubscribe(MonoZip.java:318)

at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)

at reactor.core.publisher.Mono.subscribe(Mono.java:3877)

at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:128)

at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)

at reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61)

at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:74)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)

at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)

at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)

at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)

at reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61)

at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)

at reactor.core.publisher.Mono.subscribe(Mono.java:3877)

at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:172)

at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)

at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:70)

at reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61)

at reactor.netty.http.server.HttpServerHandle.onStateChange(HttpServerHandle.java:64)

at reactor.netty.tcp.TcpServerBind$ChildObserver.onStateChange(TcpServerBind.java:228)

at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:460)

at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:90)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)

at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:167)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)

at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)

at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)

at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)

at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)

at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)

at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)

at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)

at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)

at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)

at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)

at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)

at java.lang.Thread.run(Thread.java:748)

2020-04-11 19:41:40.331  INFO 16272 --- [ctor-http-nio-2] o.x.g.filter.GlobalResponseLogFilter     : 


================ Gateway Response Start  ================

<=== 401 GET: /xx-system/dict/dictionary?code=flow

===Headers===  transfer-encoding: [chunked]

===Headers===  Content-Type: [application/json;charset=UTF-8]

================  Gateway Response End  =================


image.png


五、若有更多详细信息,请在下面提供。



1条回答
  • AKXLOLCD2]WIG8W%%4(`~CX.png4E8N9CIOYLHFNFC7H{OGJ42.png

    检查下这两个文件都改了没有

    CP4]8KYP$5D5(1IYWJS3JCP.png

    然后在AuthFilter打断点调试看下解析token这块


    0 讨论(0)
提交回复