Docs Menu

Class ApiKeyAuth

On this page

  • io.realm.mongodb.auth
  • Method Summary
  • Inherited Methods
  • Method Detail
  • call
  • create
  • createAsync
  • delete
  • deleteAsync
  • disable
  • disableAsync
  • enable
  • enableAsync
  • equals
  • fetch
  • fetchAll
  • fetchAsync
  • getApp
  • getUser
  • hashCode
  • toString
java.lang.Object
io.realm.mongodb.auth.ApiKeyAuth

This class exposes functionality for a user to manage API keys under their control.

Modifier and Type
Method and Description
protected abstract void
int functionType,
String arg,
OsJavaNetworkTransport.NetworkTransportJNIResultCallback callback
)
public ApiKey
String name
)

Creates a user API key that can be used to authenticate as the user.

Asynchronously creates a user API key that can be used to authenticate as the user.

public void
ObjectId id
)

Deletes a specific API key created by the user.

Deletes a specific API key created by the user.

public void
ObjectId id
)

Disables a specific API key created by the user.

Disables a specific API key created by the user.

public void
ObjectId id
)

Enables a specific API key created by the user.

Enables a specific API key created by the user.

public boolean
public ApiKey
ObjectId id
)

Fetches a specific user API key associated with the user.

Fetches all API keys associated with the user.

public List

Fetches all API keys associated with the user.

Fetches a specific user API key associated with the user.

public App

Returns the App that this instance in associated with.

public User

Returns the User that this instance in associated with.

public int
public String
  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize
protected abstract void call (
int functionType,
String arg,
OsJavaNetworkTransport.NetworkTransportJNIResultCallback callback
)
public ApiKey create (
String name
)

Creates a user API key that can be used to authenticate as the user.The value of the key must be persisted at this time as this is the only time it is visible.

The key is enabled when created. It can be disabled by calling disable(ObjectId) .

Parameters

  • name - the name of the key

Returns

the new API key for the user.

Throws

Asynchronously creates a user API key that can be used to authenticate as the user.The value of the key must be persisted at this time as this is the only time it is visible.

The key is enabled when created. It can be disabled by calling disable(ObjectId) .

Parameters

  • name - the name of the key
  • callback - callback when key creation has completed or failed. The callback will always happen on the same thread as this method is called on.

Throws

public void delete (
ObjectId id
)

Deletes a specific API key created by the user.

Parameters

  • id - the id of the key to delete.

Throws

Deletes a specific API key created by the user.

Parameters

  • id - the id of the key to delete.
  • callback - callback used when the was deleted or the call failed. The callback will always happen on the same thread as this method was called on.

Throws

public void disable (
ObjectId id
)

Disables a specific API key created by the user.

Parameters

  • id - the id of the key to disable.

Throws

Disables a specific API key created by the user.

Parameters

  • id - the id of the key to disable.
  • callback - callback used when the key was disabled or the call failed. The callback will always happen on the same thread as this method was called on.

Throws

public void enable (
ObjectId id
)

Enables a specific API key created by the user.

Parameters

  • id - the id of the key to enable.

Throws

Enables a specific API key created by the user.

Parameters

  • id - the id of the key to enable.
  • callback - callback used when the key was enabled or the call failed. The callback will always happen on the same thread as this method was called on.

Throws

public boolean equals (
)

Overrides

equals in class Object

public ApiKey fetch (
ObjectId id
)

Fetches a specific user API key associated with the user.

Parameters

  • id - the id of the key to fetch.

Throws

Fetches all API keys associated with the user.

Parameters

  • callback - callback used when the keys were fetched or the call failed. The callback will always happen on the same thread as this method was called on.

Throws

public List fetchAll ()

Fetches all API keys associated with the user.

Throws

Fetches a specific user API key associated with the user.

Parameters

  • id - the id of the key to fetch.
  • callback - callback used when the key was fetched or the call failed. The callback will always happen on the same thread as this method was called on.

Throws

public App getApp ()

Returns the App that this instance in associated with.

Returns

The App that this instance in associated with.

public User getUser ()

Returns the User that this instance in associated with.

Returns

The User that this instance in associated with.

public int hashCode ()

Overrides

hashCode in class Object

public String toString ()

Overrides

toString in class Object

←  Class ApiKeyClass EmailPasswordAuth →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.