//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OpenId.Provider {
using System;
using System.Diagnostics.Contracts;
using Validation;
///
/// An interface to provide custom identifiers for users logging into specific relying parties.
///
///
/// This interface would allow, for example, the Provider to offer PPIDs to their users,
/// allowing the users to log into RPs without leaving any clue as to their true identity,
/// and preventing multiple RPs from colluding to track user activity across realms.
///
public interface IDirectedIdentityIdentifierProvider {
///
/// Gets the Identifier to use for the Claimed Identifier and Local Identifier of
/// an outgoing positive assertion.
///
/// The OP local identifier for the authenticating user.
/// The realm of the relying party receiving the assertion.
///
/// A valid, discoverable OpenID Identifier that should be used as the value for the
/// openid.claimed_id and openid.local_id parameters. Must not be null.
///
Uri GetIdentifier(Identifier localIdentifier, Realm relyingPartyRealm);
///
/// Determines whether a given identifier is the primary (non-PPID) local identifier for some user.
///
/// The identifier in question.
///
/// true if the given identifier is the valid, unique identifier for some uesr (and NOT a PPID); otherwise, false.
///
[Pure]
bool IsUserLocalIdentifier(Identifier identifier);
}
}