"REST API"에서 토큰 기반/쿠키 기반 인증을 사용하고 싶습니다. 즉, API를 소비자가 사용할 수 있으려면 사용자가 username/password를 사용하여 인증 URL을 호출하여이 토큰을 가져와야합니다.인증 호출의 REST 설계
Set-Cookie Header를 반환해도됩니까?
실제로 REST 원칙을 어긴 것이라고 생각하지만 HTTP 기본 인증 (요청할 때마다 사용자 이름/암호를 보내는 것을 의미) 없이는 어떻게 하시겠습니까?
어쩌면 이렇게 할 수 있을까요?
GET api/authentication/signin/?username=abc&pwd=123
GET api/authentication/signout
또는?
GET api/user/authtoken/?username=abc&pwd=123 (signin)
DELETE api/user/authtoken/ (signout)
GET api/user/ (returning details of the current user)
등록은 어떻게됩니까?
POST api/user/ (which would also return an authtoken)
또는?
GET api/user/abc/authtoken/?pwd=123 (signin of user abc)
DELETE api/user/abc/authtoken/ (signout)
GET api/user/abc/ (returning details of user abc)
나는 많은 시나리오에서 이것이 최선의 접근이라고 동의하지만 HTTP 기본 인증을 구현하고 싶지는 않다고 명시 적으로 말했습니다. – Max