anchor.diff:  						type = ?Identity, identifier = EapId, data = <<>>},
   				NewEapMessage = ocs_eap_codec:eap_packet(NewEapPacket),
   				NewRequest = Request#diameter_eap_app_DER{'EAP-Payload' = NewEapMessage},
  -				start_fsm(Sup, Address, Port, 5, PasswordReq, SessionId, AuthType,
  +				start_fsm(Sup, Address, Port, 5, PasswordReq, SessionId, AuthRequestType,
   						OHost, ORealm, DHost, DRealm, [], CbProc, NewRequest, State);
   			{error, none} ->
   				NewEapPacket = #eap_packet{code = failure, identifier = EapId},
   				NewEapMessage = ocs_eap_codec:eap_packet(NewEapPacket),
   				Answer = #diameter_eap_app_DEA{'Session-Id' = SessionId,
  -						'Auth-Application-Id' = 5, 'Auth-Request-Type' = AuthType,
  +						'Auth-Application-Id' = 5, 'Auth-Request-Type' = AuthRequestType,
   						'Result-Code' = ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
   						'Origin-Host' = OHost, 'Origin-Realm' = ORealm,
   						'EAP-Payload' = [NewEapMessage]},
  
positive.code: %% @doc Return values for Session-Id and Auth-Request-Type attributes in
  %% DIAMETER Request.
  %% @hidden
  get_attibutes(Request) when is_record(Request, diameter_nas_app_AAR) ->
  	#diameter_nas_app_AAR{'Session-Id' = SessionId,
  			'Auth-Request-Type' = Type} = Request,
  	{SessionId, Type};
  get_attibutes(Request) when is_record(Request, diameter_eap_app_DER) ->
  	#diameter_eap_app_DER{'Session-Id' = SessionId,
  		'Auth-Request-Type' = Type} = Request,
  	{SessionId, Type}.
  
  -spec get_alternate(PreferenceOrder, AlternateMethods, State) -> Result
  	when
  
negative.code: request1(EapType, Address, Port, PasswordReq,
  		OHost, ORealm, DHost, DRealm, Request, CbProc,
  		#state{handlers = Handlers} = State) ->
  	{SessionId, AuthRequestType} = get_attibutes(Request),
  	request2(EapType, SessionId, AuthRequestType,
  			gb_trees:lookup(SessionId, Handlers),
  			Address, Port, PasswordReq, OHost, ORealm,
  			DHost, DRealm, Request, CbProc, State).
  %% @hidden
  request2({_, _Identity}, SessionId, AuthRequestType, none, Address, Port,
  		PasswordReq, OHost, ORealm, DHost, DRealm, Request, CbProc,
  		#state{pwd_sup = Sup, method_prefer = pwd} = State) ->
  	start_fsm(Sup, Address, Port, 5, PasswordReq, SessionId,
  			AuthRequestType, OHost, ORealm, DHost, DRealm, [], CbProc, Request, State);
  request2(none, SessionId, AuthRequestType, none, Address, Port,
  		PasswordReq, OHost, ORealm, DHost, DRealm,
  		#diameter_nas_app_AAR{'User-Name' = [UserName], 'User-Password' = [Password]} = Request,
  		CbProc, #state{simple_auth_sup = Sup} = State) ->
  	start_fsm(Sup, Address, Port, 1, PasswordReq, SessionId,
  			AuthRequestType, OHost, ORealm, DHost, DRealm, [UserName, Password],
  			CbProc, Request, State);
  request2({legacy_nak, EapId, AlternateMethods},
  		SessionId, AuthRequestType, {value, ExistingFsm},
  		Address, Port, PasswordReq, OHost, ORealm,
  		DHost, DRealm, Request, CbProc,
  		#state{method_order = MethodOrder} = State) ->
  