1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 package org.apache.directory.server.ldap.handlers.sasl.ntlm; 21 22 23 import org.apache.mina.core.session.IoSession; 24 25 26 /** 27 * An NTLM authentication service provider. Multiple providers may be 28 * utilized to conduct the NTLM negotiation over various protocols or by 29 * calling native SSPI interfaces. 30 * 31 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 32 */ 33 public interface NtlmProvider 34 { 35 /** 36 * Handles a Type 1 NTLM response from the client to generate an NTLM 37 * Type 2 challenge message. 38 * 39 * @param session the MINA IoSession to store any state to be thread safe 40 * @param type1reponse the Type 1 NTLM response from client 41 * @return the NTLM Type 2 message with the challenge 42 * @throws Exception If the challenge cannot be generated 43 */ 44 byte[] generateChallenge( IoSession session, byte[] type1reponse ) throws Exception; 45 46 47 /** 48 * Handles a Type 3 NTLM response from the client. 49 * 50 * @param session the MINA IoSession to store any state to be thread safe 51 * @param type3response the Type 3 NTLM response from the client 52 * @return the result of the authentication from the server 53 * @throws Exception If the authentication failed 54 */ 55 boolean authenticate( IoSession session, byte[] type3response ) throws Exception; 56 }