Basic HTTP and Bearer Token Authentication

前端 未结 7 1185
谎友^
谎友^ 2020-12-22 21:39

I am currently developing a REST-API which is HTTP-Basic protected for the development environment. As the real authentication is done via a token, I\'m still trying to figu

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-22 22:31

    With nginx you can send both tokens like this (even though it's against the standard):

    Authorization: Basic basic-token,Bearer bearer-token
    

    This works as long as the basic token is first - nginx successfully forwards it to the application server.

    And then you need to make sure your application can properly extract the Bearer from the above string.

提交回复
热议问题