Interface AuthDomainGenericAuthCallback
- All Superinterfaces:
FunctionPointer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
AuthDomainGenericAuthCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
run
(AuthDomain domain, ServerMessage msg, String username) The prototype for aSoupAuthDomain
generic authentication callback.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default int
upcall
(MemorySegment domain, MemorySegment msg, MemorySegment username, MemorySegment userData) Theupcall
method is called from native code.
-
Method Details
-
run
The prototype for aSoupAuthDomain
generic authentication callback.The callback should look up the user's password, call
AuthDomain.checkPassword(org.gnome.soup.ServerMessage, java.lang.String, java.lang.String)
, and use the return value from that method as its own return value.In general, for security reasons, it is preferable to use the auth-domain-specific auth callbacks (eg,
AuthDomainBasicAuthCallback
andAuthDomainDigestAuthCallback
), because they don't require keeping a cleartext password database. Most users will use the same password for many different sites, meaning if any site with a cleartext password database is compromised, accounts on other servers might be compromised as well. For many of the cases whereServer
is used, this is not really relevant, but it may still be worth considering. -
upcall
default int upcall(MemorySegment domain, MemorySegment msg, MemorySegment username, MemorySegment userData) Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.soup.AuthDomain, org.gnome.soup.ServerMessage, java.lang.String)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-