3 #include "RelationalAccess/AuthenticationCredentials.h"
4 #include "RelationalAccess/AuthenticationServiceException.h"
8 #include "RelationalAccess/AuthenticationServiceException.h"
9 #include "CoralKernel/IPropertyManager.h"
10 #include "CoralKernel/Property.h"
11 #include "CoralKernel/Context.h"
19 #include <boost/bind.hpp>
21 #include "CoralBase/MessageStream.h"
25 :
coral::
Service(
key), m_authenticationPath(
""), m_db(), m_cache(), m_callbackID(0) {
26 boost::function1<void, std::string> cb(boost::bind(
29 coral::Property* pm = dynamic_cast<coral::Property*>(
45 const coral::IAuthenticationCredentials&
48 const coral::IAuthenticationCredentials* creds = m_cache.get(
connectionString);
51 coral::MessageStream
log(
"cond::RelationalAuthenticationService::credentials");
52 log <<
coral::Debug <<
"Connecting to the credential repository in \"" << credsStoreConn <<
"\" with principal \""
53 << m_db.keyPrincipalName() <<
"\"." << coral::MessageStream::endmsg;
54 m_db.selectForUser(m_cache);
60 msg +=
" with role \"COND_DEFAULT_ROLE\" is not available for ";
61 msg += m_db.keyPrincipalName();
62 cond::throwException(
msg,
"cond::RelationalAuthenticationService::RelationalAuthenticationService::credentials");
67 const coral::IAuthenticationCredentials&
70 const coral::IAuthenticationCredentials* creds = m_cache.get(
connectionString, role);
73 coral::MessageStream
log(
"cond::RelationalAuthenticationService::credentials");
74 log <<
coral::Debug <<
"Connecting to the credential repository in \"" << credsStoreConn <<
"\" with principal \""
75 << m_db.keyPrincipalName() <<
"\"." << coral::MessageStream::endmsg;
76 m_db.selectForUser(m_cache);
82 msg +=
" with role \"" + role +
"\" is not available for ";
83 msg += m_db.keyPrincipalName();
84 cond::throwException(
msg,
"cond::RelationalAuthenticationService::RelationalAuthenticationService::credentials");
90 return m_db.keyPrincipalName();
94 "COND/Services/RelationalAuthenticationService");