0

I am developing a mobile banking application that will use REST web services implemented in Java using Jersey. So I want a login page that will use GET method, If user enters correct user name password then He will get a page that contain list of all accounts.

1)Login details will be sent in json. 2)Server will does authentication for that user if user is authorized server will get back with list of accounts in JSON. 3)These accounts will be displayed on new html page in the form of list.

So, My question is, how do I implement this or suggest me any better solution.

Thanks in advance.

Ajit
  • 957
  • 1
  • 8
  • 24

1 Answers1

0

Basic Authentication

// ...
    @Context HttpHeaders headers;
    // ...
    protected boolean authenticate() {
        String header = headers.getRequestHeader("authorization").get(0);
        header = header.substring("Basic ".length());
        String[] creds = new String(Base64.base64Decode(header)).split(":");
        String username = creds[0];
        String password = creds[1];
        // ...
    }
// ...
TheWhiteRabbit
  • 15,480
  • 4
  • 33
  • 57