IdentityProvider.vala 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. using Invercargill;
  2. namespace Spry.Authorisation {
  3. /**
  4. * Interface for retrieving Identity objects by ID or username.
  5. *
  6. * The AuthorisationContext uses this to get_current_identity_async().
  7. * Applications register their implementation during startup.
  8. *
  9. * Built-in implementation: Spry.Authentication.UserIdentityProvider
  10. */
  11. public interface IdentityProvider : GLib.Object {
  12. /**
  13. * Retrieves an Identity by its unique ID.
  14. *
  15. * @param id The identity ID from the token
  16. * @return The Identity, or null if not found/inactive
  17. * @throws Error on retrieval failure
  18. */
  19. public abstract async Identity? get_identity_by_identifier(Element identifier) throws Error;
  20. /**
  21. * Retrieves an Identity by its username.
  22. *
  23. * @param username The username to look up
  24. * @return The Identity, or null if not found/inactive
  25. * @throws Error on retrieval failure
  26. */
  27. public abstract async Identity? get_identity_by_username(string username) throws Error;
  28. }
  29. }