Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public com.squareup.okhttp.Request authenticate(Proxy proxy, com.squareup.okhttp.Response response) throws IOException {
- boolean isDemo = ServerConfig.DEMO_HOST_NAME.equals(response.request().url().getHost());
- String user = isDemo ? ServerConfig.DEMO_USER_NAME : ServerConfig.STAGING_USER_NAME;
- String passw = isDemo ? ServerConfig.DEMO_PASSWORD : ServerConfig.STAGING_PASSWORD;
- String credential = Credentials.basic(user, passw);
- return response.request().newBuilder()
- .header("Authorization", credential)
- .build();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement