1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-28 06:03:40 +00:00

identity server client for auth

This commit is contained in:
Kyle Spearrin
2017-05-06 20:20:57 -04:00
parent 7117f00480
commit d1cf6c68f3
15 changed files with 84 additions and 23 deletions

View File

@@ -12,9 +12,23 @@ namespace Bit.App
{
var tokenService = Resolver.Resolve<ITokenService>();
var appIdService = Resolver.Resolve<IAppIdService>();
if(!string.IsNullOrWhiteSpace(tokenService.Token))
{
Headers.Add("Authorization", $"Bearer2 {tokenService.Token}");
var httpService = Resolver.Resolve<IHttpService>();
var bearerString = "Bearer";
var tokenIssuer = tokenService.TokenIssuer;
if(tokenIssuer == httpService.ApiClient.BaseAddress.OriginalString)
{
bearerString = string.Concat(bearerString, "2");
}
else if(tokenIssuer == httpService.IdentityClient.BaseAddress.OriginalString)
{
bearerString = string.Concat(bearerString, "3");
}
Headers.Add("Authorization", $"{bearerString} {tokenService.Token}");
}
if(!string.IsNullOrWhiteSpace(appIdService.AppId))
{