Im trying to port an app from iOS to java but the docs are pretty broken, I was given a sample bit of code that is used to authenticate the user.
"To authentication, the HTTP Header "Authorization" must be set with the value "Basic base64encodedValue" where base64encodedValue is the string of "email:password" (the user's email and password) encoded in base 64. The authorization call in objective-c looks like the following:"
- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username password:(NSString *)
password {
NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password];
[self setValue:[NSString stringWithFormat:@"Basic %@",
AFBase64EncodedStringFromString(basicAuthCredentials)] forHTTPHeaderField:@"Authorization"];
}
Returns authentication_token - This token needs to be supplied to the methods in the HTTP Header "Authorization""
The wording is strange so is this just adding a generic header to the http request? is the key for the header request "Authorization" with a value of the base64 encoded "username:password"
or is the key actually "Basic base64encodedValue" ?
or is it actually sending basic authenitcation with the request?