Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Synopsis: int pbs_auth_create_ctx(void **ctx, int mode, int conn_type, char *hostname)
  • Description: This API creates an authentication context for a given mode and conn_type, which will be used by other LibAuth API for authentication, encrypt and decrypt data.
  • Arguments:

...

Use AUTH_SERVER for server-side (aka who is authenticating incoming user/connection) context

enum AUTH_ROLE {
        AUTH_ROLE_UNKNOWN = 0,
        AUTH_CLIENT,
        AUTH_SERVER,
        AUTH_ROLE_LAST
};

int conn_type

Specify which type of connection is for which context to be created, should be one of AUTH_USER_CONN or AUTH_SERVICE_CONN

Use AUTH_USER_CONN for user-oriented connection (aka like PBS client is connecting to PBS Server)

Use AUTH_SERVICE_CONN for service-oriented connection (aka like PBS Mom is connecting to PBS Server via PBS Comm)

enum AUTH_CONN_TYPE {
        AUTH_USER_CONN = 0,
        AUTH_SERVICE_CONN
};

char *hostname

The null-terminated hostname of another authenticating party

  • Return Value: Integer
    • 0 - On Success
    • 1 - On Failure
  • Cleanup: A context created by this API should be destroyed by auth_destroy_ctx when the context is no more required

...

  • Return Value: Integer
    • 0 - On Success
    • 1 - On Failure
  • Cleanup: Returned user, host, and realm should be freed using free() when no more required, as it will be allocated heap memory.
  • Example: This example shows what will be the value of the user, host, and realm. Let's take an example of GSS/Kerberos authentication, where auth client hostname is "xyz.abc.com", the username is "test" and in Kerberos configuration domain realm is "PBSPRO" so when this auth client authenticates to server using Kerberos authentication method, it will be authenticated as "test@PBSPRO" and this API will return user = test, host = xyz.abc.com, and realm = PBSPRO.

...