跳转到主内容

运行 API 调用时出现"收到无效会话 ID"错误消息

Views:
134
Visibility:
Public
Votes:
0
Category:
fabric-interconnect-and-management-switches
Specialty:
brocade
Last Updated:

适用于

  • Brocade
  • SANnav

问题

  • 使用登录 API 调用生成会话 ID 后,生成的会话 ID 将用于运行后续 API 调用,但会抛出Invalid session id received 错误消息。 

[root@xxxxxxxx ~]# curl -k -H 'username: ' -H 'password: ' -H 'Content-Type: application/json' -X POST https://10.225.xx.xx/external-api/v1/login/
{"sessionId":"4a84bce3-b086-4df6-b209-fbff6a54bb55"}[root@xxxxxxxx ~]#
[root@xxxxxxxx ~]#
[root@xxxxxxxx ~]# curl -vv -k -H 'Authorization: 4a84bce3-b086-4df6-b209-fbff6a54bb55' -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://10.225.xx.xx/external-api/v1/discovery/fabrics
Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying 10.225.xx.xx...
* TCP_NODELAY set
* Connected to 10.225.xx.xx (10.225.xx.xx) port 443 (#0)
* ALPN, offering h2

.

.

.
* Connection #0 to host 10.225.xx.xx left intact
{"code":401,"errorMessage":"UnAuthorizedException","detailedErrorMessage":"Invalid authorization token in the request: {\"ResponseCode\":\"AUTHENTICATION_2017\",\"ResponseId\":\"authentication.sessionvalidation.invalidsessionid\",\"ResponseMessage\":\"Invalid session id received\"}"}
 
 

  • 会话 ID 与执行初始登录的主机 IP 地址相关联。如果正在使用 HTTPS 代理,则 IP 地址可能会更改,并且会话 ID 将显示为无效。但是,主机未使用 HTTPS 代理。
  • SANnav 日志只有一个对 IP 地址的引用:
    authentication-rbac-mw - [INFO ] 2024-04-01 16:45:07.665 [http-nio-12009-exec-3] com.brocade.dcm.authentication.server.controller.AuthenticationController - Login Request from client : 10.1.xx.xx with isGlobal flag: [null]
    authentication-rbac-mw - [INFO ] 2024-04-01 16:45:07.727 [http-nio-12009-exec-3] com.brocade.dcm.authentication.server.controller.AuthenticationController - Authentication successful and sessionId is e947f2c3-d66e-4c01-8655-cd05f129d9e0 for user ROuser, client 10.1.xx.xx
    10.1.42.81 - - [01/Apr/2024:16:45:07 +0530] "POST /external-api/v1/login/ HTTP/2.0" 200 52 "-""curl/7.61.1"

 

  • 如果已知此日期的会话 ID,它仍应可用于后续 REST 命令,或者可以注销
  • REST 也可以在无会话模式下使用,该模式不使用会话 ID。
  • 也尝试了无会话身份验证,但身份验证失败 invalid username and password error。  但是,相同的凭据可以通过 GUI 控制台正常工作。

 

所有测试登录都以相同的方式失败:

2024-04-23 16:29:51 curl -k -H 'Authorization: Basic ' -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://10.225.xx.xx/external-api/v1/discovery/fabrics

SANnav 访问日志:

10.1.xx.xx - ROuser [23/Apr/2024:16:29:51 +0530] "GET /external-api/v1/discovery/fabrics HTTP/2.0" 401 148 "-""curl/7.61.1"

SANnav 身份验证日志:

authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.550 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.controller.AuthenticationController - Login Request from client : 10.1.xx.xx with isGlobal flag: [null]
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.558 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.controller.AuthenticationController -  Maximum session limit: 25, current session count: 8, current sessionLess count: 0 and  totalSessionCount: 8
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.558 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Primary authentication setting is Local Database and secondary authentication setting is None
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.565 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.LocalDbRealm - Authentication status after verifying using MD5 encryption false
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Done with primary authentication. Auth status: false, fallback status: 0
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Falling back to local authentication false .....?
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Login status for user ROuser after authentication and user role check: false Is locally Authenticated false
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Authentication failed for user ROuser status 0 
authentication-rbac-mw - [ERROR] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Authentication failed for user ROuser authType Local Database
authentication-rbac-mw - [ERROR] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.controller.AuthenticationController - Login failed! Authentication exception occured for client 10.1.xx.xx
org.apache.shiro.authc.AuthenticationException: Invalid username and password

Sign in to view the entire content of this KB article.

New to NetApp?

Learn more about our award-winning Support

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.