c# - How to show a customized windows authentication with sql server -
i have table in listdown ips allow access of service. service is
website/service.asmx
in there hundreds of web methods.
the table name: iptable column: ip nvarchar(max) 202.192.25.150 215.215.215.215 115.119.185.199 when person hit on above service first check requester ip address ,suppose if in list open windows authentication popup (customize)*, else redirect on root website root. *customize: windows authentication mean user/password check sql server's table h_user not windows users,
so question possible show customized windows authentication ?
i'm not sure how can implement windows authentication requirement. can implement customized authentication below.
- create authentication method
- use
request.userhostaddressretrieve client ip address - check requested ip address valid or not (from table)
- if valid returns true else false
- use
- call authentication method in every web method
- if returns true proceed next; else redirect root site
authentication method signature:
public bool isauthenticateduser() { -- requested ip address -- check requested ip address available or not -- if requested ip address available in db allow proceed; else redirect root site } call method in main.
Comments
Post a Comment