Poco::OSP::Auth

class AuthService

Library: OSP
Package: Auth
Header: Poco/OSP/Auth/AuthService.h

Description

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.

Inheritance

Direct Base Classes: Poco::OSP::Service

All Base Classes: Poco::OSP::Service, Poco::RefCountedObject

Known Derived Classes: AuthAdminService, AbstractLDAPAuthAdminService

Member Summary

Member Functions: authenticate, authorize, isA, type

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

Types

Ptr

typedef Poco::AutoPtr < AuthService > Ptr;

Constructors

AuthService

AuthService();

Creates the AuthService.

Destructor

~AuthService virtual

~AuthService();

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;