BoC.Security.Mvc.OpenIdRelyingPartyService.CreateRequests C# (CSharp) Method

CreateRequests() public method

public CreateRequests ( Identifier userSuppliedIdentifier, Realm realm, Uri returnTo, Uri privacyPolicy ) : IEnumerable
userSuppliedIdentifier DotNetOpenAuth.OpenId.Identifier
realm DotNetOpenAuth.OpenId.Realm
returnTo System.Uri
privacyPolicy System.Uri
return IEnumerable
        public IEnumerable<IAuthenticationRequest> CreateRequests(Identifier userSuppliedIdentifier, Realm realm, Uri returnTo, Uri privacyPolicy)
        {
            if (userSuppliedIdentifier == null)
            {
                throw new ArgumentNullException("userSuppliedIdentifier");
            }
            if (realm == null)
            {
                throw new ArgumentNullException("realm");
            }
            if (returnTo == null)
            {
                throw new ArgumentNullException("returnTo");
            }

            var requests = relyingParty.CreateRequests(userSuppliedIdentifier, realm, returnTo);

            foreach (IAuthenticationRequest request in requests)
            {
                // Ask for the user's email, not because we necessarily need it to do our work,
                // but so we can display something meaningful to the user as their "username"
                // when they log in with a PPID from Google, for example.
                request.AddExtension(new ClaimsRequest
                {
                    Email = DemandLevel.Require,
                    FullName = DemandLevel.Request,
                    PolicyUrl = privacyPolicy,
                });

                yield return request;
            }
        }