This question already has answers here:
Configure Microsoft.AspNet.Identity to allow email address as username
(13 answers)
Closed 9 years ago.
I am using Asp.Net Webforms application. I used Microsoft.AspNet.Identity for authentication. I want use user's email address as username. But it doesn't let.
can you help me please?
Probably the problem is the use of non-alphanumeric characters in username. If so use this
UserManager.UserValidator = new UserValidator<TUser>(UserManager) {
AllowOnlyAlphanumericUserNames = false }
Related
This question already has answers here:
Can I read the hash portion of the URL on my server-side application (PHP, Ruby, Python, etc.)?
(12 answers)
How to get Url Hash (#) from server side
(6 answers)
Closed 1 year ago.
Hi after redirection from OAuth server, I am unable to get the complete URL in my JAVA Servlet.My URL looks like below -
https://host.vp.com/gui/MainPage.gdi#scope=openid%20profile&id_token=eyJ0eXAiOiJKV86sada0ajdasJUUEB343KHFKK
I tried request.getRequestURL() , request.getRequestURL(), request.getPathInfo(), no luck in getting the part of the URL which starts after #, i.e., scope=openid%20profile&id_token=eyJ0eXAiOiJKV86sada0ajdasJUUEB343KHFKK, Can someone help me here?
Your Query string should start with ? instead of # to be able to read in the Selvlet.
This question already has answers here:
Routing with Multiple Parameters using ASP.NET MVC
(3 answers)
Closed 4 years ago.
for example, flask can get param in url:
".com/<name>/<token>"
get 'name' and 'token' as Variable .
Does asp.net can do this?
You can use attribute routing in ASP.Net Web API and should use the Route attribute
[HttpGet]
[Route("GetSomething/{name}/{token})"]
public MyResponse GetSomething(string name, string token)
{
...
}
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am developing a website using ASP.NET MVC, how can I get the current location (Country, city, district, lat-lng geolocation) of each visitor browses my website depending on IP address?
It's possible to get location by using IP address of visitor. Use web-service provided by ipinfodb.com :
string url = string.Format("https://api.ipinfodb.com/v3/ip-city/?key={0}&ip={1}&format=json", APIKey, ipAddress);
using (WebClient client = new WebClient())
{
string json = client.DownloadString(url);
Location location = new JavaScriptSerializer().Deserialize<Location>(json);
return location;
}
There are several services out there that can do this. Try, for example, this one: http://geoip.nekudo.com.
An example: http://geoip.nekudo.com/api/8.8.8.8
Look for "ip geolocation rest api".
There are many geo-localization service you can use. For example, I do this way.
Put this tag inside your main .html page:
<script type="text/javascript" src="https://l2.io/ip.js?var=userIp"></script>
Than you will find a global variable called userIp with the calling ip address.
Than you can use any geolocation tool to get all the information you need.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to generate some passwords (password generator), but I want to avoid characters that can be confused with each other (for example: Chair2bok). How can I do that?
Why don't you just use a character set that you DO want to use rather than those to avoid?
A standard set of 64 characters
!#%+23456789:=?#ABCDEFGHJKLMNPRS
TUVWXYZabcdefghijkmnopqrstuvwxyz
A larger set of 88 characters
!"#$%&'()*+,-./23456789:;<=>?#ABCDEFGHJKLMNO
PRSTUVWXYZ[\]^_abcdefghijkmnopqrstuvwxyz{|}~
Source: Characters to avoid in automatically generated passwords
I blogged about how to generate a strong password for SQL Server HERE.
It uses strings that you can remove the characters you don't want. I've already removed some like 1, I, 0, and O.
private static string CHARS_LCASE = "abcdefgijkmnopqrstwxyz";
private static string CHARS_UCASE = "ABCDEFGHJKLMNPQRSTWXYZ";
private static string CHARS_NUMERIC = "23456789";
private static string CHARS_SPECIAL = "*-+_%/";
private static string CHARS_ALL = CHARS_LCASE + CHARS_UCASE
+ CHARS_NUMERIC + CHARS_SPECIAL;
To generate passwords of various complexity, you can use the services. For example, GetPas (online password generator).
This question already has answers here:
ASP.NET MVC: Route with optional parameter, but if supplied, must match \d+
(6 answers)
Closed 9 years ago.
I want to use the url such as "/ControllerName/ActionName/Id"
Id - only digits or null.
But when I use regular expression in MapRoute, "\d{1,4}", I see the exception - error404 page, when I'm trying to see /ControllerName/ActionName/" page.
Also, I don't know, how I can catch exception with special symbol - ".
Please, help.Thanx.
Try using ( *|\d{1,4}).