Brocade Fibre Channel Networking Community

Expand all | Collapse all

Does anyone know why my BNA's REST API WStoken stays valid after logout?

  • 1.  Does anyone know why my BNA's REST API WStoken stays valid after logout?

    Posted 11-18-2015 11:27 AM

    Hi,

     

    After successfully connected to a BNA server I received a WStoken to help me with the queries.

    After retrieving all of the data I needed, I logged out using the /logout API and received the HTTP status code of 204.

    Why does the BNA server allow me to continue querying the API after I logged out and does not tell me the token is invalid?

     

    $ curl -ks -X POST -H "WSUsername:Admin" -H "WSPassword:AdminPass" -H "Accept:application/vnd.brocade.networkadvisor+json;version=v1" -i https://1.1.1.1/rest/login
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    WStoken: uwDqBAwAHj6pTzulmONxNoawBXw=
    Content-Type: application/vnd.brocade.networkadvisor+json;version="v1"
    Content-Length: 251
    Date: Wed, 18 Nov 2015 19:19:32 GMT
    
    {"serverName":"Win2012Template","serverIp":"1.1.1.1"}
    
    $ curl -ks -X GET -H "WStoken:uwDqBAwAHj6pTzulmONxNoawBXw=" -H "Accept:application/vnd.brocade.networkadvisor+json;version=v1" https://1.1.1.1/rest/resourcegroups/All/fcswitches
    {"fcSwitches":[],"startIndex":null,"itemsPerPage":null,"totalResults":null}
    
    $ curl -ks -X POST -H "WStoken:uwDqBAwAHj6pTzulmONxNoawBXw=" -H "Accept:application/vnd.brocade.networkadvisor+json;version=v1" -i https://1.1.1.1/rest/logout
    HTTP/1.1 204 No Content
    Server: Apache-Coyote/1.1
    Date: Wed, 18 Nov 2015 19:20:04 GMT
    
    
    $ curl -ks -X GET -H "WStoken:uwDqBAwAHj6pTzulmONxNoawBXw=" -H "Accept:application/vnd.brocade.networkadvisor+json;version=v1" https://1.1.1.1/rest/resourcegroups/All/fcswitches
    {"fcSwitches":[],"startIndex":null,"itemsPerPage":null,"totalResults":null}

    #BrocadeFibreChannelNetworkingCommunity
    #bna
    #restapi


  • 2.  Re: Does anyone know why my BNA's REST API WStoken stays valid after logout?

    Posted 12-06-2015 05:47 AM

    This doesn't happen on my other BNA server that is not on it's trial period


    #BrocadeFibreChannelNetworkingCommunity