Subversion Repositories SmartDukaan

Rev

Rev 396 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 396 Rev 398
Line 19... Line 19...
19
	private UserContextServiceClient client = null;
19
	private UserContextServiceClient client = null;
20
	
20
	
21
	private int errorCode = 0;
21
	private int errorCode = 0;
22
	private String errorMessage;
22
	private String errorMessage;
23
	
23
	
-
 
24
	private String id;
-
 
25
	
24
	public AuthController(){
26
	public AuthController(){
25
		try {
27
		try {
26
			client = new UserContextServiceClient();
28
			client = new UserContextServiceClient();
27
		} catch (Exception e) {
29
		} catch (Exception e) {
28
			e.printStackTrace();
30
			e.printStackTrace();
Line 33... Line 35...
33
	public Object getModel() {
35
	public Object getModel() {
34
		return auth;
36
		return auth;
35
	}
37
	}
36
	
38
	
37
	public HttpHeaders create(){
39
	public HttpHeaders create(){
38
		
40
		System.out.println(auth);
-
 
41
		return new DefaultHttpHeaders("lsuccess");
39
		//AUTH service to be invoked from here
42
		//AUTH service to be invoked from here
40
		Client c = client.getClient();
43
		Client c = client.getClient();
41
		try {
44
		try {
-
 
45
			
42
			if (c.authenticateUser(auth.getUserName(), auth.getPassword(), true)){
46
			if (c.authenticateUser(auth.getUserName(), auth.getPassword(), true)){
43
				return new DefaultHttpHeaders("lsuccess");
47
				return new DefaultHttpHeaders("lsuccess");
44
			}
48
			}
45
		} catch (AuthenticationException e) {
49
		} catch (AuthenticationException e) {
46
			
50
			
Line 60... Line 64...
60
	}
64
	}
61
 
65
 
62
	public String getErrorMessage() {
66
	public String getErrorMessage() {
63
		return errorMessage;
67
		return errorMessage;
64
	}
68
	}
-
 
69
	
-
 
70
	public String getId(){
-
 
71
		return id;
-
 
72
	}
-
 
73
	
-
 
74
	public String setId(){
-
 
75
		this.id = id;
-
 
76
	}
65
}
77
}