class AuthService

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

Known Derived Classes: AbstractLDAPAuthAdminService, Poco::OSP::Auth::Data::AuthAdminServiceImpl, AuthAdminService

Member Summary

Member Functions: authenticate, authorize, isA, type, userExists

Inherited Functions: duplicate, isA, referenceCount, release, type

Types Aliases


using Ptr = Poco::AutoPtr < AuthService >;




Creates the AuthService.


~AuthService virtual


Destroys the AuthService.

Member Functions

authenticate virtual

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.

authorize virtual

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.

isA virtual

bool isA(
    const std::type_info & otherType
) const;

type virtual

const std::type_info & type() const;

userExists virtual

virtual bool userExists(
    const std::string & userName
) const = 0;

Checks if a user has exists.

Returns true if the user specified by userName exists, otherwise false.