|
Hi,
We are working on a project, where there are 2 different web applications are used by the same user. Hence we need Single Signon (SSO), so that when a user is logged in one application opens the second application, it should not ask for relogin, if the user have permissions.
Our web application is on .net core 3.1
We had implemented SSO using identity 4. we had refereed a sample application (.net core 2.0 and identity 4 server 2.0) and implemented the same.
Issues facing
1. Even if a user have permissions for both the applications and logged in to 1 application, when he tries to open the 2nd application, it asks to signin again(ie, it is not authorized)
2. For admin user, which have all the permission, it fails to open the application due to cookie memory issue.
We have tried to upgrade the identity 4 server to the latest (4.1), but it through run time error.
Please help to resolve the issue.
|
|
|
|
|
If you're talking about IdentityServer[^], you're best source of information is going to be the people that wrote it. There's a "Contact" link in the upper right corner of the site.
|
|
|
|
|
Follow the cookie or the token.
How Does Single Sign-On (SSO) Work? | OneLogin
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hi,
I am building desktop application using .net framework. Front end will be deployed in client PC and database will be kept in LAN server. In this case which is best database to be used.
Since I am new to client-server implementation how to make sure connection string while installing front end in client PC and is there any instance of database needs to installed before establishing connectivity. I don't want to too much dependencies while installation since client is startup company and not able to invest on licence databases.
Regards,
Rahul
|
|
|
|
|
You could use SQL Server Express, or google for free\open source database solutions, but using SQL Express would make it easier to go to proper SQL Server when they can afford it. However I would strongly question any company, start-up or not, that can't afford to properly license software and I'd also be wary working for such a company.
|
|
|
|
|
What SiteCore said - SQL Express will give you 4gb of storage and limited connections but will allow you to easily upgrade to a licenced version when you outgrow the express.
I do hope you are doing this pro bono or as a training/entry exercise, it does sound dodgy.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Packaging will be the least of your problems: "I am building..."
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Você pode usar o MYSQl, e gratuito e atende bem para uma empresa de pequeno ou médio porte.
|
|
|
|
|
I see some articles on migrating away from .NET remoting, but so far I haven't found anything that flat out says I shouldn't use it for new projects.
Does anyone know the state of the world regarding .NET remoting in say... DNF 4.72?
I have no requirements to support Core because my project involves a window service that does interprocess communication. I want to use .NET remoting for that. It's not internet facing, it's purely for IPC.
Real programmers use butterflies
|
|
|
|
|
It doesn't seem to be explicitly obsolete, but it's definitely a legacy technology, and not meant for new projects.
.NET Remoting is a legacy product that is supported only for backward compatibility. ... We recommend existing Remoting applications be migrated to newer and more secure technologies.
.NET Remoting was identified as a problematic architecture. It's used for cross-AppDomain communication, which is no longer supported. Also, Remoting requires runtime support, which is expensive to maintain. For these reasons, .NET Remoting isn't supported on .NET Core, and we don't plan on adding support for it in the future.
It looks like Remoting won't be ported to .NET 5 either.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
And in addition to the above question:
(1) Is WCF deprecated? (I thought it was deprecated but perhaps I'm wrong).
(2) What is the latest recommended relatively high speed inter-process communication standard?
|
|
|
|
|
I'm implementing asp.net core 3.1 project. In my controller I have a linq query like the following and without defining inprocessapicount and pendingcount which claculates counts of related amounts, it works fine but after adding them to my query in select part, applicants returns null. I appreciate if anyone suggests me a solution.
var applicants = (from t1 in _context.VwDesk
{
apiID = t1.ApiId,
applicantID = t1.ApplicantId,
applicantName = t1.ApplicantName,
gateName =t1.GateName,
requestStatus = t1.LastReqStatus
}
group tg by new { tg.requestStatus,tg.apiID ,tg.applicantID, tg.applicantName} into ApiAppGp
select new
{
applicantName = ApiAppGp.Key.applicantName,
apiname = ApiAppGp.Key.apiID,
apicount =ApiAppGp.Count(),
inprocessapicount = ApiAppGp.Where(a => a.requestStatus == "bb").Count(),
pendingapicount = ApiAppGp.Where(a => a.requestStatus == "aa").Count()
}).ToList();
|
|
|
|
|
Query's too "complicated" for anyone to bother with. Need to break it down with intermediate queries and results that you can "debug". "Big" queries are a sign of laziness; not sophistication. LINQ is no smarter than the person wielding it.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I think I finally understand OAuth/OIDC/IdentityServer/IdMgr/IUA/ASP.NET Identity well enough to recognize the answer to my question.
Can anyone point me at a full featured end user self registration example/add-on for IdentityServer 3 or 4?
I'm aware of the admin UI ad-ons. I'm looking for an end-user oriented features that allows end-users to register themselves, including contact info and administer their contact info once registered.
I'd like functionality similar to Individual User Accounts in MVC projects. I'd also like the functionality, including UI, to reside on the STS and integrate with the STS OIDC authorization functionality.
A user registration add-on for IdentityServer 3 or 4 would make my day.
Or, is it true that comprehensive turn-key user registration for IdentityServer does not exist?
I have reviewed and ran the IdSvr3 AspNetIdentity integration samples. If end user self registration is there I don't see it.
I have seen a few examples that showed how to add a user registration page to identity server but they seemed more like a hack than comprehensive user self registration/contact info admin feature, ALA MVC Individual User Accounts.
Using IdentityServer4 hosted in a .NET Core web app as the STS is an option I've explored. I didn't find any complete examples there either.
|
|
|
|
|
The Skoruba admin UI, IdSvr4 only, includes a user self registration feature.
modified 9-Aug-20 10:35am.
|
|
|
|
|
I have two linq queries like the following and their output results are correct:
var mytotal = _context.Apiapplicant.Where(c => !c.ApiRequestDate.Equals("") && c.IsDeleted.Equals(false)).GroupBy(o => new
{
Month = o.ApiRequestDate.Substring(5, 2),
Year = o.ApiRequestDate.Substring(0, 4)
}).Select(g => new
{
Month = g.Key.Month,
Year = g.Key.Year,
Total = g.Count()
}).OrderByDescending(a => a.Year).ThenByDescending(a => a.Month).ToList();
The above query gives the total requests that was registerd in each month.
var numerator = from t1 in _context.Apiapplicant
join t2 in _context.ApiApplicantHistory on t1.Id equals t2.ApiApplicantId
join t3 in _context.EntityType on t2.LastReqStatus equals t3.Id
where t1.IsDeleted == false && t3.Name == "granted" && t2.Date != null && t1.ApiRequestNo != null
group t1
by new
{
lastReq = t2.LastReqStatus,
Year = t2.Date.Substring(0, 4),
Month = t2.Date.Substring(5, 2)
} into g
select new
{
Year = g.Key.Year,
Month = g.Key.Month,
lastReq = g.Key.lastReq,
GrantedCount = g.Count()
};
var GrantedReqStatus = numerator.OrderByDescending(x => x.Year).ThenByDescending(a => a.Month).ToList();
The above query gives total requests for each month that has "granted" status. Now I want to find for all the requests that are registered in each month, how many of them has "granted" status. To obtain it, I've made a query like the following which should join both GrantedReqStatus and mytotal queries:
var LastGrantedStatus = (from t1 in mytotal
from t2 in GrantedReqStatus
where (t1.Month == t2.Month) && (t1.Year == t2.Year)
group t1
by new
{
Year = t1.Year,
Month = t1.Month
} into g
select new { Month=g.Key.Month, Year=g.Key.Year,grcount = g.Count()}).ToList();
But when I run the project, the following expressions doesn't print anything:
Console.WriteLine("LastGrantedStatus.Count:" + LastGrantedStatus.Count);
foreach (var t in LastGrantedStatus)
{
Console.WriteLine("t.GrantedCount + t.Month:" + t.Month + "+" + t.grcount);
}
|
|
|
|
|
Don't attempt to join. Have the results in their lists as you already have, and then check those lists for items that are "common/similar".
The more you do in a linq query, the more complex it becomes, up to the point where you get stuck on questions like this one. Do the queries, then continue processing, instead of trying to merge the queries.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I'm implementing an asp.net core 3.1 project. I connect my project to active directory using Novell.Directory.Ldap.NETStandard and the logged in user also can logged out from the web project. Below is my login method:
public async Task<IActionResult> Login(LoginModel model)
{
var result = _authenticationService.ValidateUser("min.fr", model.UserName, model.Password);
if (result)
{
var claims = new List<Claim>
{
new Claim(ClaimTypes.Name, model.UserName),
new Claim(ClaimTypes.Role, "Administrator")
};
var claimsIdentity = new ClaimsIdentity(
claims, CookieAuthenticationDefaults.AuthenticationScheme);
await HttpContext.SignInAsync(
CookieAuthenticationDefaults.AuthenticationScheme,
new ClaimsPrincipal(claimsIdentity),
authProperties);
}
return RedirectToAction(nameof(MDashboardController.Index), "MDashboard");
}
Now my problem is I want to show logged in user's image in my web project but I don't know how can I retrieve logged in user's data including his photo from active directory. I appreciate if anyone can suggests me a solution to do it.
|
|
|
|
|
You're going to have to ask the people that wrote that library.
I find it a bit odd that this even exists because Novell ceased to exist back in 2014.
|
|
|
|
|
Below Code which I have tried:
NetworkCredential myCred = new NetworkCredential("xxxxx@xx.xxx.xxx", "xxxxxxxx");
using (var handler = new HttpClientHandler { Credentials = myCred })
{
HttpClient client = new HttpClient(handler);
client.BaseAddress = new Uri("https://xxxxx.xxx.xx:2601/api/getallprices");
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(client.BaseAddress);
HttpWebResponse WebResp = (HttpWebResponse)request.GetResponse();
}
Here when I tried to get response from request url, it throws an error
"Unable to connect to remote server"... Can please anyone help me out to solve this error !!
|
|
|
|
|
The URL is wrong, or the port is wrong, or one of the firewalls between the client and the server is blocking the request.
You'll need to look at the details of the exception and debug the connection. We can't do that for you.
For example, if the error says "the target machine actively refused", that normally points to a firewall. If it's a timeout, then the URL or port is wrong.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi All, I would welcome recommendations on how to secure a Net Core API which I curently host on a publicly facing Linux box ( I'm using Apache as a reverse proxy server ) - it's in development and I would like ( if it's possible ) to restrict access to only my development LAN at home - I hope this makes sense
"We can't stop here - this is bat country" - Hunter S Thompson - RIP
|
|
|
|
|
Is your API using REST or some other form of communication? Rather than worrying about limiting it to your home network, you could simply secure the API using something like OAuth2.
|
|
|
|
|
Hi Pete, it's just a basic ASP Net Core MVC API - when it's finished I will look at something like OAuth2 , at the moment while it's in development ( because it has real data in a database ( maybe I should change that ) ) I'd like to nail it down so only someone on my local LAN can connect to the API - as you know I'm not expert in all things Web
"We can't stop here - this is bat country" - Hunter S Thompson - RIP
|
|
|
|
|
I'm experiencing some (new) and very odd behaviours trying to send outbound email from my ASP.Net websites. These are running on a shared-host setup and use ASP.Net Framework webforms. In the past I've been able to do this very simply:
In Web.config:
<system.net>
<mailSettings>
<smtp from="me@mydomain.com" deliveryMethod="Network">
<network host="mail.mydomain.com" userName="me@mydomain.com" password="notneeded" defaultCredentials="false" />
</smtp>
</mailSettings>
</system.net><pre lang="HTML">
then in the code
SmtpClient smtp = new SmtpClient();
smtp.Send("sender@mydomain.com", "recipient@somedomain.com" "subject", "message"); NOTE that the password defined in web.config really is the literal "notneeded". When running these sites on my local development box, the correct password for the named sending account is indeed required; but when uploaded to the server, the password is ignored (and the setting can be removed completely).
As of some time on Friday I became aware that email sending from all my sites was failing. I reported the issue to my hosting company but in the meantime attempted to find a fix myself. I found that entering the "correct" password worked fine. (Later this weekend the hosting company, who had denied ANY configuration changes at their end, then made further changes that resulted in all the amended sites failing again. They then told me to change to a different SMTP server (mail.hostingcompany.com ); however that didn't work for me. After several hours further testing showed it DID now work, so I updated all the sites again. Later this evening I also found that once again the original mail.mydomain.com host address was working again.
This was all pretty frustrating; I don't pretend to understand SMTP very well and am really not sure how / why omitting the password (or using a dummy one) worked, but it did. That was a Good Thing because it meant I didn't have to hard-code my email password in plain text in web.config, and also meant that when I change my email password I don't also need to go in and change web.config for the domain and all its sub-domains.
So I have some questions:
1. WHY did omitting password work, when the site was running on the same server as the SMTP host?
2. WHAT configuration change could the host have made to cause this to STOP working?
3. Most confusingly of all... there is ONE subdomain that continued to work fine WITHOUT the password through all this. I've examined the code carefully and it definitely does NOT specify the password (either in web.config or in code). Other subdomains of the same domain, which used identical SMTP configuration, now require the password; just this ONE does not.
I'm annoyed with my hosting company, as it's perfectly clear THEY have changed something that caused all my websites to break; not only did they not forewarn, they continue to deny they changed anything. They've subsequently made further changes that broke my fix and then yet more that allow my fix to work. But I'm also completely befuddled as to why things ever worked, then why they didn't, and why one identically-configured site continues to work as it always did!
|
|
|
|
|