Discuss big data frameworks/technologies such as Hadoop, Spark, etc.
Forums
Discuss about cloud computing technologies, learning resources, etc.
This forum is for general programming, development related discussions.
Any Kontext website related questions, please publish here incl. feature suggestions, bug reports, other feedbacks, etc. Visit Help Centre to learn how to use Kontext platform efficiently.
apache-lucene .net azure
its saved in the default user identity table. I have the below code with no errors but no photo shown.
<div class="profile-wrapper">
<img src="@User.FindFirst("PictureSource")?.Value" class="profile" />
<div class="titles d-flex flex-column ps-3">
<h6 class="mb-0">Expense Tracher</h6>
<span class="text-muted">Logged In</span>
</div>
</div>
Hi Rami, depends on where you save the photo attribute to, you just need to query it from the store. You can use entity framework for this.
Hi,
I managed to save the path in the DB but now in my sidebar how to get the path from the db into the img field below:
<img class="profile-pic" src="~/profile2.jpg" />
@* change based on login *@
@if (!SignInManager.IsSignedIn(User))
{
<div class="profile-wrapper">
<img class="profile-pic" src="~/profile.jpg" />
<div class="titles d-flex flex-column ps-3">
<h6 class="mb-0">Expense Tracher</h6>
<span class="text-muted">Guest</span>
<a href="/">Please Login</a>
</div>
</div>
}
else
{
<div class="profile-wrapper">
<img class="profile-pic" src="~/profile2.jpg" />
<div class="titles d-flex flex-column ps-3">
<h6 class="mb-0">Expense Tracher</h6>
<span class="text-muted">Logged In</span>
</div>
</div>
}
Yes, photo is included in the response JWT token payload:
https://cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Auth.GoogleJsonWebSignature.Payload#Google_Apis_Auth_GoogleJsonWebSignature_Payload_Picture
GoogleJsonWebSignature.Payload.Picture
Hi Again Raymond,
I came up with a question. Is there a way to get the profile photo from google using the payload?
Thanks for the info. I will also try the extension.
I found this extension which seems to work as expected:
https://github.com/Trottero/dotnet-watch-attach
Would love to see it nativley supported by VS code though. There is an open issue for it:
https://github.com/dotnet/vscode-csharp/issues/4822
You are welcome. I am glad it now works for you.
Thanks alot for helping me out. I finally managed to do it.
private readonly SignInManager<IdentityUser> _signManager;
private readonly UserManager<IdentityUser> _userManager;
public HomeController(UserManager<IdentityUser> userManager, SignInManager<IdentityUser> signManager)
{
_userManager = userManager;
_signManager = signManager;
}
and in my function:
var user = new IdentityUser { UserName = payload.Email, Email = payload.Email };
await _userManager.CreateAsync(user).ConfigureAwait(false);
await _signManager.SignInAsync(user, isPersistent: false).ConfigureAwait(false);
return RedirectToAction("Index","Category");
Hi Rami,
You can use
UserManager
class in Identity to retrieve the user information defined in your ownApplicationUser
class.UserManager<TUser>.GetUserAsync(ClaimsPrincipal) Method (Microsoft.AspNetCore.Identity) | Microsoft Learn
For parameter
principal
it is available in Razor page or MVC Controller class directly after the user is authenticated.