Skip to content

Authorization Methods

Danilo edited this page Jun 19, 2020 · 2 revisions

Overview

The authorizationMethod property allows to set the authentication in the header of the request or in the header of SOAP message.

Values

Name Description
SOAP_AUTH_BASIC Basic Authentication in the header of request.
SOAP_AUTH_BASICAUTH Basic Authentication in the header of SOAP message.
SOAP_AUTH_DIGEST Digest Authentication in the header of request.
SOAP_AUTH_TOKEN JWT Token Authentication like a social token.
SOAP_AUTH_WSSECURITY Web Services Security (WS-Security, WSS).
SOAP_AUTH_WSSECURITY_TEXT Web Services Security (WS-Security, WSS) with text password.
SOAP_AUTH_CUSTOM Generic custom Authentication.
SOAP_AUTH_PAYPAL PayPal Authentication.
SOAP_AUTH_SOCIAL Social Authentication (no longer available).

Samples

Basic Authentication in the header of request :
SOAPEngine *soap = [[SOAPEngine alloc] init];
    
soap.authorizationMethod = SOAP_AUTH_BASIC;
soap.username = @"my-username";
soap.password = @"my-password";
Basic Authentication in the header of SOAP message :
soap.authorizationMethod = SOAP_AUTH_BASICAUTH;
soap.username = @"my-username";
soap.password = @"my-password";
Digest Authentication in the header of request :
soap.authorizationMethod = SOAP_AUTH_DIGEST;
soap.username = @"my-username";
soap.password = @"my-password";
soap.realm = @"my-realm";
Token Authentication :
soap.authorizationMethod = SOAP_AUTH_TOKEN;
soap.token = @"bXktdXNl....tcGFzc3dvcmQ=";
Web Services Security (WS-Security, WSS) :
soap.authorizationMethod = SOAP_AUTH_WSSECURITY;
soap.username = @"my-username";
soap.password = @"my-password";
Web Services Security (WS-Security, WSS) with text password :
soap.authorizationMethod = SOAP_AUTH_WSSECURITY_TEXT;
soap.username = @"my-username";
soap.password = @"my-password";
Custom Authentication :
// SOAP custom header with attributes
soap.authorizationMethod = SOAP_AUTH_CUSTOM;
soap.header = @{
	@"username" : @{
		@"value" : @"my-password",
		@"attributes": @{ @"xmlns:": @"http://my-namespace" }
	}, @"password" : @"my-password"
};