This source file includes following definitions.
- ParseAuthTokenWithService
#include "remoting/base/auth_token_util.h"
#include "remoting/base/constants.h"
namespace remoting {
void ParseAuthTokenWithService(const std::string& auth_service_with_token,
std::string* auth_token,
std::string* auth_service) {
size_t delimiter_pos = auth_service_with_token.find(':');
if (delimiter_pos == std::string::npos) {
auth_token->assign(auth_service_with_token);
auth_service->assign(kChromotingTokenDefaultServiceName);
} else {
auth_service->assign(auth_service_with_token.substr(0, delimiter_pos));
if (delimiter_pos < auth_service_with_token.size()) {
auth_token->assign(auth_service_with_token.substr(delimiter_pos + 1));
} else {
auth_token->clear();
}
}
}
}