Skip to content
Matt Wagner edited this page Oct 25, 2012 · 1 revision

Realm Mappings

{{toc}}

A mapping from a front end realm to either a provider or a provider realm.

The realm in realmorprovidertype is the provider realm. * Perhaps we should rename this parameter to providerrealmorprovider_type.
Type in this case is either the provider or the provider realm, not a “provider type”.

Create a new realm mapping

Request

Mapping to a provider with provider_id = 1.

curl -X POST --user admin:password --header "Content-Type: application/xml" \
--header "Accept: application/xml" -k  https://localhost/conductor/api/realm_mappings \
--data "
<realm_backend_target>
  <frontend_realm_id>1</frontend_realm_id>
  <provider_realm_or_provider_type>Provider</provider_realm_or_provider_type>
  <provider_realm_or_provider_id>1</provider_realm_or_provider_id>
</realm_backend_target>"

Response

<realm_mapping id="1" href="https://localhost/conductor/api/realm_mappings/1">
  <frontend_realm id="1" href="https://localhost/conductor/api/frontend_realms/1"></frontend_realm>
  <provider id="1" href="http://localhost/conductor/api/providers/1"></provider>
</realm_mapping>

Request

Mapping to a provider realm with id = 2.

curl -X POST --user admin:password --header "Content-Type: application/xml" \
--header "Accept: application/xml" -k  https://localhost/conductor/api/realm_mappings \
--data "
<realm_backend_target>
  <frontend_realm_id>1</frontend_realm_id>
  <provider_realm_or_provider_type>ProviderRealm</provider_realm_or_provider_type>
  <provider_realm_or_provider_id>2</provider_realm_or_provider_id>
</realm_backend_target>"

Response

<realm_mapping id="1" href="https://localhost/conductor/api/realm_mappings/1">
  <frontend_realm id="1" href="https://localhost/conductor/api/frontend_realms/1"></frontend_realm>
  <provider_realm id="2" href="http://localhost/conductor/api/provider_realms/2"></provider_realm>
</realm_mapping>

List all realm mappings

Request

curl -X GET --user admin:password --header "Accept: application/xml" -k  https://localhost/conductor/api/realms_mappings

Response

<realm_mappings>
<realm_mapping href='http://localhost:3000/api/realm_mappings/1' id='1'></realm_mapping>
<realm_mapping href='http://localhost:3000/api/realm_mappings/3' id='3'></realm_mapping>
<realm_mapping href='http://localhost:3000/api/realm_mappings/2' id='2'></realm_mapping>
</realm_mappings>

Show a single realm mapping’s details

Request

curl -X GET --user admin:password --header "Accept: application/xml" -k  https://localhost/conductor/api/realm_mappings/1

Response

Provider type:

<realm_mapping id="1" href="https://localhost/conductor/api/realm_mappings/1">
  <frontend_realm id="1" href="https://localhost/conductor/api/frontend_realms/1"></frontend_realm>
  <provider id="1" href="http://localhost/conductor/api/providers/1"></provider>
</realm_mapping>

ProviderRealm type:

<realm_mapping id="1" href="https://localhost/conductor/api/realm_mappings/1">
  <frontend_realm id="1" href="https://localhost/conductor/api/frontend_realms/1"></frontend_realm>
  <provider_realm id="2" href="http://localhost/conductor/api/provider_realms/2"></provider_realm>
</realm_mapping>

Delete a realm mapping

Request

curl -X DELETE --user admin:password --header "Accept: application/xml" -k  https://localhost/conductor/api/realm_mappings/1

Response

If success,

<realm_mapping id="1">
 <status>DELETED</status>
</realm_mapping>

If failure,

<code>
<error>
  <code>RecordNotFound</code>
  <message>Couldn't find realm mapping with ID=1</message>
</error>
</code>
Clone this wiki locally