Realm Identity Stores

Since Payara Server 5.194

The Payara API provides a way to authenticate with existing realms using the @RealmIdentityStoreDefinition annotation.

Usage

Example

The following code sample illustrates how to configure realm identity store:

@ApplicationScoped
@ApplicationPath("/rest")
@DeclareRoles({ "a", "b" })
@BasicAuthenticationMechanismDefinition(realmName = "file")
@RealmIdentityStoreDefinition("file")
public class MyRestApp extends Application {
}

The RealmIdentityStoreDefinition is a repeatable annotation hence multiple realms can also be defined:

@ApplicationScoped
@ApplicationPath("/rest")
@DeclareRoles({ "a", "b" })
@BasicAuthenticationMechanismDefinition
@RealmIdentityStoreDefinition("realm1")
@RealmIdentityStoreDefinition("realm2")
public class MyRestApp extends Application {
}

Configuration

The @RealmIdentityStoreDefinition annotation is configured with the options as shown below.

Option Description Default Required

value

The name of the existing realm.

Default realm

results matching ""

    No results matching ""