mirror of
https://github.com/bitwarden/server.git
synced 2025-04-09 07:08:15 -05:00
FIDO U2F facet fiel headers
This commit is contained in:
parent
0a12006d32
commit
e70323b59e
@ -126,6 +126,11 @@ http {
|
|||||||
# a specific directory, or on an individual server{} level.
|
# a specific directory, or on an individual server{} level.
|
||||||
# gzip_static on;
|
# gzip_static on;
|
||||||
|
|
||||||
|
# Content type for FIDO U2F facets
|
||||||
|
map $uri $fido_content_type {
|
||||||
|
default "application/fido.trusted-apps+json";
|
||||||
|
}
|
||||||
|
|
||||||
# Include files in the sites-enabled folder. server{} configuration files should be
|
# Include files in the sites-enabled folder. server{} configuration files should be
|
||||||
# placed in the sites-available folder, and then the configuration should be enabled
|
# placed in the sites-available folder, and then the configuration should be enabled
|
||||||
# by creating a symlink to it in the sites-enabled folder.
|
# by creating a symlink to it in the sites-enabled folder.
|
||||||
|
@ -145,6 +145,13 @@ server {{
|
|||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
location = /app-id.json {{
|
||||||
|
proxy_pass http://web/app-id.json;
|
||||||
|
proxy_hide_header Content-Type;
|
||||||
|
add_header Content-Type $fido_content_type;
|
||||||
|
proxy_redirect off;
|
||||||
|
}}
|
||||||
|
|
||||||
location /api/ {{
|
location /api/ {{
|
||||||
proxy_pass http://api/;
|
proxy_pass http://api/;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
@ -209,6 +216,29 @@ SA_PASSWORD={dbPass}");
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void BuildAppId()
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory("/bitwarden/web/");
|
||||||
|
using(var sw = File.CreateText("/bitwarden/web/app-id.json"))
|
||||||
|
{
|
||||||
|
sw.Write($@"{{
|
||||||
|
""trustedFacets"": [
|
||||||
|
{{
|
||||||
|
""version"": {{
|
||||||
|
""major"": 1,
|
||||||
|
""minor"": 0
|
||||||
|
}},
|
||||||
|
""ids"": [
|
||||||
|
""{_url}"",
|
||||||
|
""ios:bundle-id:com.8bit.bitwarden"",
|
||||||
|
""android:apk-key-hash:dUGFzUzf3lmHSLBDBIv+WaFyZMI""
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
]
|
||||||
|
}}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static IDictionary<string, string> ParseParameters()
|
private static IDictionary<string, string> ParseParameters()
|
||||||
{
|
{
|
||||||
var dict = new Dictionary<string, string>();
|
var dict = new Dictionary<string, string>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user