High Performance OPC UA Server SDK
1.7.1.383
|
Interface for implementing an authentication backend. More...
Modules | |
internal | |
For more information on the internal authentication backend and usage examples see Authentication. | |
Data Structures | |
struct | ua_authentication_ctx |
Context with information about a user trying to activate a session for the authentiation backend. More... | |
Functions | |
int | ua_authentication_init (uint32_t max_users) |
Initialize structures needed for managing user authentication. More... | |
void | ua_authentication_clear (void) |
Clear structures needed for managing user authentication. More... | |
ua_statuscode | ua_authenticate_user (struct ua_authentication_ctx *ctx, struct uasession_user_info *user) |
Authenticate a user which tries to activate a session. More... | |
int | ua_authentication_load_from_file (const char *passwd_file) |
Load user authentication information from a file. More... | |
Interface for implementing an authentication backend.
The functions declared here must be implemented by every authentication backend and are mainly intended for use by the SDK.
Adding and Removing users is backend specific and thus implemented in the backends like internal.
ua_statuscode ua_authenticate_user | ( | struct ua_authentication_ctx * | ctx, |
struct uasession_user_info * | user | ||
) |
Authenticate a user which tries to activate a session.
In case of an error this function may synchronously return a bad statuscode, a return value of zero means this function finishes async by calling uasession_activatesession_finish with ctx
as argument. It is not possible for this function to succesfully finish sync, but it may return pseudo-async by calling uasession_activatesession_finish before returning zero, in this case it must be ensured the return value is always zero.
The implementation of this function needs to use the ctx
to verify the authenticity of the user and fill the required information into the user
struct. The user
struct is initialized and the fields token_type and policy_id are already set correctly. The result is set to a bad statuscode and must be explicitly set to zero on success. All other fields are null/empty, so the implementation must set the client_user_id and the token specific fields.
ctx | Context with information about the user trying to activate the session. |
user | Preallocated struct for user information. |
void ua_authentication_clear | ( | void | ) |
Clear structures needed for managing user authentication.
All users wil be removed and no user will be able to authenticate any longer.
int ua_authentication_init | ( | uint32_t | max_users | ) |
Initialize structures needed for managing user authentication.
max_users | Maximum number of users, that can be added. |
int ua_authentication_load_from_file | ( | const char * | passwd_file | ) |
Load user authentication information from a file.
passwd_file | Name of the file to load authentication information from. |