| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS. |
| | | * Portions copyright 2011-2013 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.controls; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | import java.util.concurrent.locks.Lock; |
| | | import java.io.IOException; |
| | | import java.util.concurrent.locks.Lock; |
| | | |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.api.AuthenticationPolicyState; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.core.PasswordPolicyState; |
| | | import org.opends.server.protocols.asn1.*; |
| | | import static org.opends.server.protocols.asn1.ASN1Constants. |
| | | UNIVERSAL_OCTET_STRING_TYPE; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.asn1.ASN1; |
| | | import org.opends.server.protocols.asn1.ASN1Reader; |
| | | import org.opends.server.protocols.asn1.ASN1Writer; |
| | | import org.opends.server.types.*; |
| | | |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.protocols.asn1.ASN1Constants.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class implements version 1 of the proxied authorization control as |
| | | * defined in early versions of draft-weltman-ldapv3-proxy (this implementation |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ProxiedAuthV1Control decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | | { |
| | |
| | | return new ProxiedAuthV1Control(isCritical, authorizationDN); |
| | | } |
| | | |
| | | @Override |
| | | public String getOID() |
| | | { |
| | | return OID_PROXIED_AUTH_V1; |
| | |
| | | } |
| | | |
| | | |
| | | Lock entryLock = null; |
| | | for (int i=0; i < 3; i++) |
| | | { |
| | | entryLock = LockManager.lockRead(authzDN); |
| | | if (entryLock != null) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | final Lock entryLock = LockManager.lockRead(authzDN); |
| | | if (entryLock == null) |
| | | { |
| | | Message message = |
| | | ERR_PROXYAUTH1_CANNOT_LOCK_USER.get(String.valueOf(authzDN)); |
| | | throw new DirectoryException(ResultCode.AUTHORIZATION_DENIED, message); |
| | | throw new DirectoryException(ResultCode.BUSY, |
| | | ERR_PROXYAUTH1_CANNOT_LOCK_USER.get(String.valueOf(authzDN))); |
| | | } |
| | | |
| | | try |