adds an entity id ...
This commit is contained in:
parent
888caf4264
commit
cac49facaa
1 changed files with 5 additions and 4 deletions
|
|
@ -27,6 +27,8 @@ namespace Yavsc.Controllers
|
||||||
public string access_token { get; set; }
|
public string access_token { get; set; }
|
||||||
public int expires_in { get; set; }
|
public int expires_in { get; set; }
|
||||||
public string grant_type { get; set; }
|
public string grant_type { get; set; }
|
||||||
|
|
||||||
|
public int entity_id { get; set; }
|
||||||
}
|
}
|
||||||
UserTokenProvider tokenProvider;
|
UserTokenProvider tokenProvider;
|
||||||
|
|
||||||
|
|
@ -70,12 +72,11 @@ namespace Yavsc.Controllers
|
||||||
foreach (Claim c in currentUser.Claims) if (c.Type == "EntityID") entityId = Convert.ToInt32(c.Value);
|
foreach (Claim c in currentUser.Claims) if (c.Type == "EntityID") entityId = Convert.ToInt32(c.Value);
|
||||||
|
|
||||||
tokenExpires = DateTime.UtcNow.AddMinutes(2);
|
tokenExpires = DateTime.UtcNow.AddMinutes(2);
|
||||||
token = await GetToken("id_token", user, tokenExpires);
|
token = await GetToken("id_token", user, tokenExpires);
|
||||||
return new TokenResponse { access_token = token, expires_in = 3400, grant_type="id_token" };
|
return new TokenResponse { access_token = token, expires_in = 3400, entity_id = entityId };
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new { authenticated = false, grant_type="id_token" };
|
return new { authenticated = false };
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AuthRequest
|
public class AuthRequest
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue