2013-10-14 4 views
1

나는 보안이 필요한 게임 응용 프로그램이 있습니다. 모듈 보안을 가져 오려고했습니다. 응용 프로그램이 지금 로그인해야하며 지금 다른 문제가 있습니다. REST에서 인증하려고합니다. 나는 인증하고 내 응용 프로그램에 대한 클라이언트 요청이? 내가이재생 프레임 워크에서 REST를 인증하는 방법 1.2.5

public static Response logIn(){ 
    DataInputStream dis = new DataInputStream(request.body); 
    String request; 
    response.status = 400; 
    try { 
     while(null != ((request = dis.readLine()))){ 
      JSONObject jsonObject = new JSONObject(request); 
      String username = jsonObject.getString("username"); 
      String password = jsonObject.getString("password"); 
      boolean authenticated = Security.authenticate(username, password); 
      if(authenticated){ 
       response.status = 200; 
       return response; 
      }else{ 
       response.status = 400; 
       return response; 
      } 
     } 
    } catch (IOException | JSONException e) { 
     e.printStackTrace(); 
    } 
    return response; 
} 

같이하려고 얼마나 의미하지만 난 나머지 클라이언트, 그것은 오류를 테스트 할 때, 그 서버에 너무 많은 리디렉션 말한다. 즉 아무 문제가 있음을

답변

0

당신은 예를 play authenticate plugin 준비 결정 중 하나를 시도하거나 플레이 프레임 워크 1.2.5을 사용하여 this article

+0

스피을 사용할 수 있습니다 추적 할 수없는 가망 경우 내 나쁜 영어 죄송합니다, 난 예를 들어 줄까? – Yusuf1494

관련 문제