mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
Merge pull request #4644 from nextcloud/detectAuth
Allow broader check on CheckAuth
This commit is contained in:
commit
07d0abe87e
1 changed files with 39 additions and 39 deletions
|
@ -97,12 +97,12 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation {
|
|||
}
|
||||
|
||||
// analyze response
|
||||
if (result.getHttpCode() == HttpStatus.SC_UNAUTHORIZED) {
|
||||
if (result.getHttpCode() == HttpStatus.SC_UNAUTHORIZED || result.getHttpCode() == HttpStatus.SC_FORBIDDEN) {
|
||||
ArrayList<String> authHeaders = result.getAuthenticateHeaders();
|
||||
|
||||
for (String header : authHeaders) {
|
||||
// currently we only support basic auth
|
||||
if (header.toLowerCase(Locale.ROOT).startsWith("basic")) {
|
||||
if (header.toLowerCase(Locale.ROOT).contains("basic")) {
|
||||
authMethod = AuthenticationMethod.BASIC_HTTP_AUTH;
|
||||
break;
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation {
|
|||
}
|
||||
|
||||
private String authenticationMethodToString(AuthenticationMethod value) {
|
||||
switch (value){
|
||||
switch (value) {
|
||||
case NONE:
|
||||
return "NONE";
|
||||
case BASIC_HTTP_AUTH:
|
||||
|
|
Loading…
Reference in a new issue