-
Notifications
You must be signed in to change notification settings - Fork 74
Domain management
When a developer manages domains in the marketplace, the Appdirect platform sends queries to endpoints on the corresponding connector. Using the SDK the developer can automatically enable endpoints on the connector in order to perform domain operations.
The following options are available:
- Add a domain
- Remove a domain
- Verify domain ownership
To add a domain to a specific account AppMarket uses the DomainAdditionHandler
endpoint to query the connector.
No payload is expected as a response.
AppMarket will use the HTTP code to determine if the operation was successful or not.
The expected HTTP code for a success is 200
.
To remove a domain from a specific account AppMarket uses the DomainRemovalHandler
endpoint to query the connector.
No payload is expected as a response.
AppMarket will use the HTTP code to determine if the operation was successful or not.
The expected HTTP code for a success is 200
.
For certain applications that can be bought on the AppMarket, in order to use the application a client must associate a domain to their account. However, very often before the domain can be used with the application, the vendor must verify that the domain is indeed owned by the application owner. The typical way to verify ownership is for the vendor to provide one or more DNS records for the application owner to include on their domain. It is assumed that only the owner of a domain would be permitted to add DNS records to it.
In order to use some applications, that can be purchased on AppMarket, a client must associate a domain with their account.
The vendor must verify the domain is owned by the application owner. To do this the vendor provides one or more DNS records for the application owner to include on their domain.
In order for AppMarket to verify domain ownership, a connector for a particular vendor must expose some HTTP endpoints. The vendor can do this by implementing the SDK-defined abstract class DomainDnsOwnershipVerificationConfiguration
, and include it in their application context.
Implementing this class automatically enables the endpoints to perform the following functionality in the client connector:
This endpoint allows the AppMarket to query the connector regarding the DNS records that must be added to a given domain in order to allow the vendor to perform ownership verification.
Implement the DomainDnsVerificationInfoHandler
endpoint to query the connector regarding the DNS records. These records are added to a domain to allow the vendor perform ownership verification. Currently the returned records are type TXT and MX.
When AppMarket calls the standard HTTP endpoint to validate domain ownership, the DomainDnsVerificationInfoHandler
endpoint is called.
The return value of the DomainDnsVerificationInfoHandler.readOwnershipVerificationRecords
method is serialized and returned to the AppMarket.
Domain ownership is verified using the DomainOwnershipVerificationHandler
interface.
When the verification process completes, either successfully or unsuccessfully, the connector notifies AppMarket asynchronously. It does this by calling the url provided in the callbackUrl parameter of the DomainOwnershipVerificationHandler.
The simplest way to perform this callback is through the provided implementation of the DomainVerificationNotificationClient
.
Include the DomainDnsOwnershipVerificationConfiguration
in your application to automatically provide a bean of this type in your application context. This interface defines a resolveDomainVerification
method that allows you to send verification success or failure back to AppMarket. You need to specify the callbackUrl, the clientKey associated with the domain verification, and a boolean parameter specifying whether the ownership verification was successful or not.
Before calling the ownership verification operation, ensure AppMarket has already retrieved the DNS records representing the ownership proof. Also ensure that these records are added to the domain whose ownership you are verifying.