PassportIdentity.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. //
  2. // System.Web.Security.PassportIdentity.cs
  3. //
  4. // Authors:
  5. // Gonzalo Paniagua Javier ([email protected])
  6. // Andreas Nahr ([email protected])
  7. //
  8. // (C) 2002 Ximian, Inc (http://www.ximian.com)
  9. // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
  10. //
  11. // Permission is hereby granted, free of charge, to any person obtaining
  12. // a copy of this software and associated documentation files (the
  13. // "Software"), to deal in the Software without restriction, including
  14. // without limitation the rights to use, copy, modify, merge, publish,
  15. // distribute, sublicense, and/or sell copies of the Software, and to
  16. // permit persons to whom the Software is furnished to do so, subject to
  17. // the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. //
  30. using System.Security.Permissions;
  31. using System.Security.Principal;
  32. namespace System.Web.Security {
  33. [MonoTODO("Not implemented")]
  34. // CAS - no InheritanceDemand here as the class is sealed
  35. [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
  36. #if NET_2_0
  37. public sealed class PassportIdentity : IIdentity, IDisposable {
  38. #else
  39. public sealed class PassportIdentity : IIdentity {
  40. #endif
  41. [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
  42. public PassportIdentity ()
  43. {
  44. }
  45. ~PassportIdentity ()
  46. {
  47. }
  48. public string AuthUrl ()
  49. {
  50. return AuthUrl (null, -1, -1, null, -1, null, -1, -1);
  51. }
  52. #if (!NET_1_0)
  53. public string AuthUrl (String strReturnUrl)
  54. {
  55. return AuthUrl (strReturnUrl, -1, -1, null, -1, null, -1, -1);
  56. }
  57. #endif
  58. public string AuthUrl (string strReturnUrl,
  59. int iTimeWindow,
  60. bool fForceLogin,
  61. string strCoBrandedArgs,
  62. int iLangID,
  63. string strNameSpace,
  64. int iKPP,
  65. bool bUseSecureAuth)
  66. {
  67. return AuthUrl (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
  68. }
  69. [MonoTODO("Not implemented")]
  70. public string AuthUrl (string strReturnUrl,
  71. int iTimeWindow,
  72. int iForceLogin,
  73. string strCoBrandedArgs,
  74. int iLangID,
  75. string strNameSpace,
  76. int iKPP,
  77. int iUseSecureAuth)
  78. {
  79. throw new NotImplementedException ();
  80. }
  81. public string AuthUrl2 ()
  82. {
  83. return AuthUrl2 (null, -1, -1, null, -1, null, -1, -1);
  84. }
  85. #if (!NET_1_0)
  86. public string AuthUrl2 (String strReturnUrl)
  87. {
  88. return AuthUrl2 (strReturnUrl, -1, -1, null, -1, null, -1, -1);
  89. }
  90. #endif
  91. public string AuthUrl2 (string strReturnUrl,
  92. int iTimeWindow,
  93. bool fForceLogin,
  94. string strCoBrandedArgs,
  95. int iLangID,
  96. string strNameSpace,
  97. int iKPP,
  98. bool bUseSecureAuth)
  99. {
  100. return AuthUrl2 (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
  101. }
  102. [MonoTODO("Not implemented")]
  103. public string AuthUrl2 (string strReturnUrl,
  104. int iTimeWindow,
  105. int iForceLogin,
  106. string strCoBrandedArgs,
  107. int iLangID,
  108. string strNameSpace,
  109. int iKPP,
  110. int iUseSecureAuth)
  111. {
  112. throw new NotImplementedException ();
  113. }
  114. [MonoTODO("Not implemented")]
  115. public static string Compress (string strData)
  116. {
  117. throw new NotImplementedException ();
  118. }
  119. [MonoTODO("Not implemented")]
  120. public static bool CryptIsValid ()
  121. {
  122. throw new NotImplementedException ();
  123. }
  124. [MonoTODO("Not implemented")]
  125. public static int CryptPutHost (string strHost)
  126. {
  127. throw new NotImplementedException ();
  128. }
  129. [MonoTODO("Not implemented")]
  130. public static int CryptPutSite (string strSite)
  131. {
  132. throw new NotImplementedException ();
  133. }
  134. [MonoTODO("Not implemented")]
  135. public static string Decompress (string strData)
  136. {
  137. throw new NotImplementedException ();
  138. }
  139. [MonoTODO("Not implemented")]
  140. public static string Decrypt (string strData)
  141. {
  142. throw new NotImplementedException ();
  143. }
  144. [MonoTODO("Not implemented")]
  145. public static string Encrypt (string strData)
  146. {
  147. throw new NotImplementedException ();
  148. }
  149. [MonoTODO("Not implemented")]
  150. public object GetCurrentConfig (string strAttribute)
  151. {
  152. throw new NotImplementedException ();
  153. }
  154. [MonoTODO("Not implemented")]
  155. public string GetDomainAttribute (string strAttribute, int iLCID, string strDomain)
  156. {
  157. throw new NotImplementedException ();
  158. }
  159. [MonoTODO("Not implemented")]
  160. public string GetDomainFromMemberName (string strMemberName)
  161. {
  162. throw new NotImplementedException ();
  163. }
  164. public bool GetIsAuthenticated (int iTimeWindow, bool bForceLogin, bool bCheckSecure)
  165. {
  166. return this.GetIsAuthenticated (iTimeWindow, (bForceLogin ? 1 : 0), (bCheckSecure ? 1 : 0));
  167. }
  168. [MonoTODO("Not implemented")]
  169. public bool GetIsAuthenticated (int iTimeWindow, int iForceLogin, int iCheckSecure)
  170. {
  171. throw new NotImplementedException ();
  172. }
  173. public string GetLoginChallenge ()
  174. {
  175. return GetLoginChallenge (null, -1, -1, null, -1, null, -1, -1, null);
  176. }
  177. #if (!NET_1_0)
  178. public string GetLoginChallenge (String strReturnUrl)
  179. {
  180. return GetLoginChallenge (strReturnUrl, -1, -1, null, -1, null, -1, -1, null);
  181. }
  182. #endif
  183. [MonoTODO("Not implemented")]
  184. public string GetLoginChallenge (string szRetURL,
  185. int iTimeWindow,
  186. int fForceLogin,
  187. string szCOBrandArgs,
  188. int iLangID,
  189. string strNameSpace,
  190. int iKPP,
  191. int iUseSecureAuth,
  192. object oExtraParams)
  193. {
  194. throw new NotImplementedException ();
  195. }
  196. [MonoTODO("Not implemented")]
  197. public object GetOption (string strOpt)
  198. {
  199. throw new NotImplementedException ();
  200. }
  201. [MonoTODO("Not implemented")]
  202. public object GetProfileObject (string strProfileName)
  203. {
  204. throw new NotImplementedException ();
  205. }
  206. [MonoTODO("Not implemented")]
  207. public bool HasFlag (int iFlagMask)
  208. {
  209. throw new NotImplementedException ();
  210. }
  211. [MonoTODO("Not implemented")]
  212. public bool HasProfile (string strProfile)
  213. {
  214. throw new NotImplementedException ();
  215. }
  216. [MonoTODO("Not implemented")]
  217. public bool HaveConsent (bool bNeedFullConsent, bool bNeedBirthdate)
  218. {
  219. throw new NotImplementedException ();
  220. }
  221. public int LoginUser ()
  222. {
  223. return LoginUser (null, -1, -1, null, -1, null, -1, -1, null);
  224. }
  225. #if (!NET_1_0)
  226. public int LoginUser (String strReturnUrl)
  227. {
  228. return LoginUser (strReturnUrl, -1, -1, null, -1, null, -1, -1, null);
  229. }
  230. #endif
  231. public int LoginUser (string szRetURL,
  232. int iTimeWindow,
  233. bool fForceLogin,
  234. string szCOBrandArgs,
  235. int iLangID,
  236. string strNameSpace,
  237. int iKPP,
  238. bool fUseSecureAuth,
  239. object oExtraParams)
  240. {
  241. return LoginUser (szRetURL, iTimeWindow, (fForceLogin ? 1 : 0), szCOBrandArgs, iLangID, strNameSpace, iKPP, (fUseSecureAuth ? 1 : 0), null);
  242. }
  243. [MonoTODO("Not implemented")]
  244. public int LoginUser (string szRetURL,
  245. int iTimeWindow,
  246. int fForceLogin,
  247. string szCOBrandArgs,
  248. int iLangID,
  249. string strNameSpace,
  250. int iKPP,
  251. int iUseSecureAuth,
  252. object oExtraParams)
  253. {
  254. throw new NotImplementedException ();
  255. }
  256. public string LogoTag ()
  257. {
  258. return LogoTag (null, -1, -1, null, -1, -1, null, -1, -1);
  259. }
  260. #if (!NET_1_0)
  261. public string LogoTag (String strReturnUrl)
  262. {
  263. return LogoTag (strReturnUrl, -1, -1, null, -1, -1, null, -1, -1);
  264. }
  265. #endif
  266. public string LogoTag (string strReturnUrl,
  267. int iTimeWindow,
  268. bool fForceLogin,
  269. string strCoBrandedArgs,
  270. int iLangID,
  271. bool fSecure,
  272. string strNameSpace,
  273. int iKPP,
  274. bool bUseSecureAuth)
  275. {
  276. return LogoTag (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, (fSecure ? 1 : 0), strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
  277. }
  278. [MonoTODO("Not implemented")]
  279. public string LogoTag (string strReturnUrl,
  280. int iTimeWindow,
  281. int iForceLogin,
  282. string strCoBrandedArgs,
  283. int iLangID,
  284. int iSecure,
  285. string strNameSpace,
  286. int iKPP,
  287. int iUseSecureAuth)
  288. {
  289. throw new NotImplementedException ();
  290. }
  291. public string LogoTag2 ()
  292. {
  293. return LogoTag2 (null, -1, -1, null, -1, -1, null, -1, -1);
  294. }
  295. #if (!NET_1_0)
  296. public string LogoTag2 (String strReturnUrl)
  297. {
  298. return LogoTag2 (strReturnUrl, -1, -1, null, -1, -1, null, -1, -1);
  299. }
  300. #endif
  301. public string LogoTag2 (string strReturnUrl,
  302. int iTimeWindow,
  303. bool fForceLogin,
  304. string strCoBrandedArgs,
  305. int iLangID,
  306. bool fSecure,
  307. string strNameSpace,
  308. int iKPP,
  309. bool bUseSecureAuth)
  310. {
  311. return LogoTag2 (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, (fSecure ? 1 : 0), strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
  312. }
  313. [MonoTODO("Not implemented")]
  314. public string LogoTag2 (string strReturnUrl,
  315. int iTimeWindow,
  316. int iForceLogin,
  317. string strCoBrandedArgs,
  318. int iLangID,
  319. int iSecure,
  320. string strNameSpace,
  321. int iKPP,
  322. int iUseSecureAuth)
  323. {
  324. throw new NotImplementedException ();
  325. }
  326. public string LogoutURL ()
  327. {
  328. return LogoutURL (null, null, -1, null, -1);
  329. }
  330. [MonoTODO("Not implemented")]
  331. public string LogoutURL (string szReturnURL,
  332. string szCOBrandArgs,
  333. int iLangID,
  334. string strDomain,
  335. int iUseSecureAuth)
  336. {
  337. throw new NotImplementedException ();
  338. }
  339. [MonoTODO("Not implemented")]
  340. public void SetOption (string strOpt, object vOpt)
  341. {
  342. throw new NotImplementedException ();
  343. }
  344. [MonoTODO("Not implemented")]
  345. public static void SignOut (string strSignOutDotGifFileName)
  346. {
  347. throw new NotImplementedException ();
  348. }
  349. [MonoTODO("Not implemented")]
  350. public object Ticket (string strAttribute)
  351. {
  352. throw new NotImplementedException ();
  353. }
  354. [MonoTODO("Not implemented")]
  355. public string AuthenticationType
  356. {
  357. get {
  358. throw new NotImplementedException ();
  359. }
  360. }
  361. [MonoTODO("Not implemented")]
  362. public int Error
  363. {
  364. get {
  365. throw new NotImplementedException ();
  366. }
  367. }
  368. [MonoTODO("Not implemented")]
  369. public bool GetFromNetworkServer
  370. {
  371. get {
  372. throw new NotImplementedException ();
  373. }
  374. }
  375. [MonoTODO("Not implemented")]
  376. public bool HasSavedPassword
  377. {
  378. get {
  379. throw new NotImplementedException ();
  380. }
  381. }
  382. [MonoTODO("Not implemented")]
  383. public bool HasTicket
  384. {
  385. get {
  386. throw new NotImplementedException ();
  387. }
  388. }
  389. [MonoTODO("Not implemented")]
  390. public string HexPUID
  391. {
  392. get {
  393. throw new NotImplementedException ();
  394. }
  395. }
  396. [MonoTODO("Not implemented")]
  397. public bool IsAuthenticated
  398. {
  399. get {
  400. throw new NotImplementedException ();
  401. }
  402. }
  403. [MonoTODO("Not implemented")]
  404. public string this [string strProfileName]
  405. {
  406. get {
  407. throw new NotImplementedException ();
  408. }
  409. }
  410. [MonoTODO("Not implemented")]
  411. public string Name
  412. {
  413. get {
  414. throw new NotImplementedException ();
  415. }
  416. }
  417. [MonoTODO("Not implemented")]
  418. public int TicketAge
  419. {
  420. get {
  421. throw new NotImplementedException ();
  422. }
  423. }
  424. [MonoTODO("Not implemented")]
  425. public int TimeSinceSignIn
  426. {
  427. get {
  428. throw new NotImplementedException ();
  429. }
  430. }
  431. #if NET_2_0
  432. void IDisposable.Dispose ()
  433. {
  434. }
  435. #endif
  436. }
  437. }