PassportIdentity.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  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-2010 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. [MonoNotSupported ("")]
  34. [MonoTODO("Not implemented")]
  35. // CAS - no InheritanceDemand here as the class is sealed
  36. [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
  37. #if NET_4_0
  38. [Obsolete ("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")]
  39. #endif
  40. #if NET_2_0
  41. public sealed class PassportIdentity : IIdentity, IDisposable {
  42. #else
  43. public sealed class PassportIdentity : IIdentity {
  44. #endif
  45. [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
  46. public PassportIdentity ()
  47. {
  48. }
  49. ~PassportIdentity ()
  50. {
  51. }
  52. public string AuthUrl ()
  53. {
  54. return AuthUrl (null, -1, -1, null, -1, null, -1, -1);
  55. }
  56. public string AuthUrl (String strReturnUrl)
  57. {
  58. return AuthUrl (strReturnUrl, -1, -1, null, -1, null, -1, -1);
  59. }
  60. public string AuthUrl (string strReturnUrl,
  61. int iTimeWindow,
  62. bool fForceLogin,
  63. string strCoBrandedArgs,
  64. int iLangID,
  65. string strNameSpace,
  66. int iKPP,
  67. bool bUseSecureAuth)
  68. {
  69. return AuthUrl (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
  70. }
  71. [MonoTODO("Not implemented")]
  72. public string AuthUrl (string strReturnUrl,
  73. int iTimeWindow,
  74. int iForceLogin,
  75. string strCoBrandedArgs,
  76. int iLangID,
  77. string strNameSpace,
  78. int iKPP,
  79. int iUseSecureAuth)
  80. {
  81. throw new NotImplementedException ();
  82. }
  83. public string AuthUrl2 ()
  84. {
  85. return AuthUrl2 (null, -1, -1, null, -1, null, -1, -1);
  86. }
  87. public string AuthUrl2 (String strReturnUrl)
  88. {
  89. return AuthUrl2 (strReturnUrl, -1, -1, null, -1, null, -1, -1);
  90. }
  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. public string GetLoginChallenge (String strReturnUrl)
  178. {
  179. return GetLoginChallenge (strReturnUrl, -1, -1, null, -1, null, -1, -1, null);
  180. }
  181. [MonoTODO("Not implemented")]
  182. public string GetLoginChallenge (string szRetURL,
  183. int iTimeWindow,
  184. int fForceLogin,
  185. string szCOBrandArgs,
  186. int iLangID,
  187. string strNameSpace,
  188. int iKPP,
  189. int iUseSecureAuth,
  190. object oExtraParams)
  191. {
  192. throw new NotImplementedException ();
  193. }
  194. [MonoTODO("Not implemented")]
  195. public object GetOption (string strOpt)
  196. {
  197. throw new NotImplementedException ();
  198. }
  199. [MonoTODO("Not implemented")]
  200. public object GetProfileObject (string strProfileName)
  201. {
  202. throw new NotImplementedException ();
  203. }
  204. [MonoTODO("Not implemented")]
  205. public bool HasFlag (int iFlagMask)
  206. {
  207. throw new NotImplementedException ();
  208. }
  209. [MonoTODO("Not implemented")]
  210. public bool HasProfile (string strProfile)
  211. {
  212. throw new NotImplementedException ();
  213. }
  214. [MonoTODO("Not implemented")]
  215. public bool HaveConsent (bool bNeedFullConsent, bool bNeedBirthdate)
  216. {
  217. throw new NotImplementedException ();
  218. }
  219. public int LoginUser ()
  220. {
  221. return LoginUser (null, -1, -1, null, -1, null, -1, -1, null);
  222. }
  223. public int LoginUser (String strReturnUrl)
  224. {
  225. return LoginUser (strReturnUrl, -1, -1, null, -1, null, -1, -1, null);
  226. }
  227. public int LoginUser (string szRetURL,
  228. int iTimeWindow,
  229. bool fForceLogin,
  230. string szCOBrandArgs,
  231. int iLangID,
  232. string strNameSpace,
  233. int iKPP,
  234. bool fUseSecureAuth,
  235. object oExtraParams)
  236. {
  237. return LoginUser (szRetURL, iTimeWindow, (fForceLogin ? 1 : 0), szCOBrandArgs, iLangID, strNameSpace, iKPP, (fUseSecureAuth ? 1 : 0), null);
  238. }
  239. [MonoTODO("Not implemented")]
  240. public int LoginUser (string szRetURL,
  241. int iTimeWindow,
  242. int fForceLogin,
  243. string szCOBrandArgs,
  244. int iLangID,
  245. string strNameSpace,
  246. int iKPP,
  247. int iUseSecureAuth,
  248. object oExtraParams)
  249. {
  250. throw new NotImplementedException ();
  251. }
  252. public string LogoTag ()
  253. {
  254. return LogoTag (null, -1, -1, null, -1, -1, null, -1, -1);
  255. }
  256. public string LogoTag (String strReturnUrl)
  257. {
  258. return LogoTag (strReturnUrl, -1, -1, null, -1, -1, null, -1, -1);
  259. }
  260. public string LogoTag (string strReturnUrl,
  261. int iTimeWindow,
  262. bool fForceLogin,
  263. string strCoBrandedArgs,
  264. int iLangID,
  265. bool fSecure,
  266. string strNameSpace,
  267. int iKPP,
  268. bool bUseSecureAuth)
  269. {
  270. return LogoTag (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, (fSecure ? 1 : 0), strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
  271. }
  272. [MonoTODO("Not implemented")]
  273. public string LogoTag (string strReturnUrl,
  274. int iTimeWindow,
  275. int iForceLogin,
  276. string strCoBrandedArgs,
  277. int iLangID,
  278. int iSecure,
  279. string strNameSpace,
  280. int iKPP,
  281. int iUseSecureAuth)
  282. {
  283. throw new NotImplementedException ();
  284. }
  285. public string LogoTag2 ()
  286. {
  287. return LogoTag2 (null, -1, -1, null, -1, -1, null, -1, -1);
  288. }
  289. public string LogoTag2 (String strReturnUrl)
  290. {
  291. return LogoTag2 (strReturnUrl, -1, -1, null, -1, -1, null, -1, -1);
  292. }
  293. public string LogoTag2 (string strReturnUrl,
  294. int iTimeWindow,
  295. bool fForceLogin,
  296. string strCoBrandedArgs,
  297. int iLangID,
  298. bool fSecure,
  299. string strNameSpace,
  300. int iKPP,
  301. bool bUseSecureAuth)
  302. {
  303. return LogoTag2 (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, (fSecure ? 1 : 0), strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
  304. }
  305. [MonoTODO("Not implemented")]
  306. public string LogoTag2 (string strReturnUrl,
  307. int iTimeWindow,
  308. int iForceLogin,
  309. string strCoBrandedArgs,
  310. int iLangID,
  311. int iSecure,
  312. string strNameSpace,
  313. int iKPP,
  314. int iUseSecureAuth)
  315. {
  316. throw new NotImplementedException ();
  317. }
  318. public string LogoutURL ()
  319. {
  320. return LogoutURL (null, null, -1, null, -1);
  321. }
  322. [MonoTODO("Not implemented")]
  323. public string LogoutURL (string szReturnURL,
  324. string szCOBrandArgs,
  325. int iLangID,
  326. string strDomain,
  327. int iUseSecureAuth)
  328. {
  329. throw new NotImplementedException ();
  330. }
  331. [MonoTODO("Not implemented")]
  332. public void SetOption (string strOpt, object vOpt)
  333. {
  334. throw new NotImplementedException ();
  335. }
  336. [MonoTODO("Not implemented")]
  337. public static void SignOut (string strSignOutDotGifFileName)
  338. {
  339. throw new NotImplementedException ();
  340. }
  341. [MonoTODO("Not implemented")]
  342. public object Ticket (string strAttribute)
  343. {
  344. throw new NotImplementedException ();
  345. }
  346. [MonoTODO("Not implemented")]
  347. public string AuthenticationType
  348. {
  349. get {
  350. throw new NotImplementedException ();
  351. }
  352. }
  353. [MonoTODO("Not implemented")]
  354. public int Error
  355. {
  356. get {
  357. throw new NotImplementedException ();
  358. }
  359. }
  360. [MonoTODO("Not implemented")]
  361. public bool GetFromNetworkServer
  362. {
  363. get {
  364. throw new NotImplementedException ();
  365. }
  366. }
  367. [MonoTODO("Not implemented")]
  368. public bool HasSavedPassword
  369. {
  370. get {
  371. throw new NotImplementedException ();
  372. }
  373. }
  374. [MonoTODO("Not implemented")]
  375. public bool HasTicket
  376. {
  377. get {
  378. throw new NotImplementedException ();
  379. }
  380. }
  381. [MonoTODO("Not implemented")]
  382. public string HexPUID
  383. {
  384. get {
  385. throw new NotImplementedException ();
  386. }
  387. }
  388. [MonoTODO("Not implemented")]
  389. public bool IsAuthenticated
  390. {
  391. get {
  392. throw new NotImplementedException ();
  393. }
  394. }
  395. [MonoTODO("Not implemented")]
  396. public string this [string strProfileName]
  397. {
  398. get {
  399. throw new NotImplementedException ();
  400. }
  401. }
  402. [MonoTODO("Not implemented")]
  403. public string Name
  404. {
  405. get {
  406. throw new NotImplementedException ();
  407. }
  408. }
  409. [MonoTODO("Not implemented")]
  410. public int TicketAge
  411. {
  412. get {
  413. throw new NotImplementedException ();
  414. }
  415. }
  416. [MonoTODO("Not implemented")]
  417. public int TimeSinceSignIn
  418. {
  419. get {
  420. throw new NotImplementedException ();
  421. }
  422. }
  423. #if NET_2_0
  424. void IDisposable.Dispose ()
  425. {
  426. }
  427. #endif
  428. }
  429. }