forked from microsoft/WSL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWslcCredentialStore.cpp
More file actions
31 lines (20 loc) · 841 Bytes
/
WslcCredentialStore.cpp
File metadata and controls
31 lines (20 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*++
Copyright (c) Microsoft. All rights reserved.
Module Name:
WslcCredentialStore.cpp
Abstract:
Implementation of credential store helpers.
--*/
#include "precomp.h"
#include "WslcCredentialStore.h"
#include "wslutil.h"
std::string wsl::windows::common::BuildRegistryAuthHeader(const std::string& username, const std::string& password, const std::string& serverAddress)
{
nlohmann::json authJson = {{"username", username}, {"password", password}, {"serveraddress", serverAddress}};
return wslutil::Base64Encode(authJson.dump());
}
std::string wsl::windows::common::BuildRegistryAuthHeader(const std::string& identityToken, const std::string& serverAddress)
{
nlohmann::json authJson = {{"identitytoken", identityToken}, {"serveraddress", serverAddress}};
return wslutil::Base64Encode(authJson.dump());
}