credential_net_auth_scope_create_from_url()

Create an authentication scope from service URL.

Synopsis:

#include <sys/credential/credential_net.h>
 
int credential_net_auth_scope_create_from_url(const char *url,
                                              credential_net_host_mask_t host_types,
                                              credential_auth_scheme_mask_t auth_schemes,
                                              credential_auth_scope_t **auth_scope)

Since:

BlackBerry 10.3.1

Arguments:

url

The URL of the service requiring authentication (null-terminated). The URL string should be null-terminated and comply with RFC 3986.

host_types

The network host types that are allowed in this authentication scope.

auth_schemes

Authentication schemes allowed in this authentication scope. If the authentication scheme is unknown use CREDENTIAL_AUTH_SCHEME_ANY or CREDENTIAL_AUTH_SCHEME_ANY_SECURE.

auth_scope

On return, a pointer to the network-based authentication scope structure, You must call credential_auth_scope_release() to release this structure when you're done using it. This is an optional parameter. If set to 0, then no return value is assigned.

Library:

libcredential (For the qcc command, use the -l bps option to link against this library)

Description:

This function allocates a new credential_auth_scope_t structure and populate it using data extracted from the input URL.

The following URL parts are used to initialize authentication scope:
  • protocol type (credential_net_protocol_t).
  • server name
  • server port: If the URL does not explicitly specify the server port, then the query is initialized with the default port for the given protocol type (for example, port 80 for HTTP).
  • resource path: If URL does not contain a resource path, then the query is initialized with an empty resource path.

Returns:

0 if operation was successful, error code otherwise.