Library: OSP
Package: Auth
Header: Poco/OSP/Auth/AuthService.h
The AuthService (authentication/authorization service) is used to authenticate users using a user name/credentials combination, and to assign certain permissions to users.
The specific format of user credentials is defined by the actual implementation of this service. In the simplest form, the credentials are a simple password.
Permissions are simple strings identifying the permissions a specific user has. The AuthService itself does not care about the syntax and format of permissions.
Direct Base Classes: Poco::OSP::Service
All Base Classes: Poco::OSP::Service, Poco::RefCountedObject
Member Functions: authenticate, authorize, isA, type
Inherited Functions: duplicate, isA, referenceCount, release, type
typedef Poco::AutoPtr < AuthService > Ptr;
AuthService();
Creates the AuthService.
~AuthService();
Destroys the AuthService.
virtual bool authenticate(
const std::string & userName,
const std::string & credentials
) const = 0;
Checks if the userName and credentials combination is valid.
Returns true if the user specified by userName is known and the specified credentials confirm the identity of the user. Returns false otherwise.
virtual bool authorize(
const std::string & userName,
const std::string & permission
) const = 0;
Checks if a user has a specific permission.
Returns true if the user specified by userName has the specified permission.
bool isA(
const std::type_info & otherType
) const;
See also: Poco::OSP::Service::isA()
const std::type_info & type() const;
See also: Poco::OSP::Service::type()