| 230 | } |
| 231 | |
| 232 | void OAuthService::AuthorisePassword( |
| 233 | const ServiceConfig& config, std::string_view userName, |
| 234 | std::string_view password, AudiocomTrace trace, |
| 235 | std::function<void(std::string_view)> completedHandler) |
| 236 | { |
| 237 | using namespace rapidjson; |
| 238 | |
| 239 | Document document; |
| 240 | document.SetObject(); |
| 241 | |
| 242 | WriteCommonFields(document, "password", "all"); |
| 243 | |
| 244 | document.AddMember( |
| 245 | "username", StringRef(userName.data(), userName.size()), |
| 246 | document.GetAllocator()); |
| 247 | |
| 248 | document.AddMember( |
| 249 | "password", StringRef(password.data(), password.size()), |
| 250 | document.GetAllocator()); |
| 251 | |
| 252 | rapidjson::StringBuffer buffer; |
| 253 | rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); |
| 254 | document.Accept(writer); |
| 255 | |
| 256 | DoAuthorise( |
| 257 | config, { buffer.GetString(), buffer.GetSize() }, trace, |
| 258 | std::move(completedHandler), false); |
| 259 | } |
| 260 | |
| 261 | void OAuthService::AuthoriseRefreshToken( |
| 262 | const ServiceConfig& config, std::string_view token, AudiocomTrace trace, |