REST WCF Authentication

I am creating a self-serving WCF service that provides 2 endpoints for each service

  • SOAP
  • REST

SOAP uses WS- * SOAP authentication (authentication header) How can I use REST authentication?

I thought of some kind of login method that will return some kind of cookie, but I can’t think of how to make this transparent to all my other calls.

thank.

+3
source share
3 answers

Requests in the RESTful system are void and therefore you need to re-authenticate with each request.

HTTP, , , HTTP HTTPS.

+4

- Generic, , :

[DataContract]
public sealed class AuthenticatedRequest<T> {
    [DataMember(Order=0)]
    public string SessionToken {get; set;}

    [DataMember(Order=1)]
    public T RequestBody {get; set; }

    public static bool IsAuthenticated () {
        . . .
    }
}
+1

Well, looking around, I found the answer, I pass a special authentication header, similar to Amazon S3.

it’s not so easy to build, but it will allow me to work without SSL and will be stateless and support all clients.

+1
source

Source: https://habr.com/ru/post/1762130/


All Articles