이 콘텐츠는 선택한 언어로 제공되지 않습니다.

7.2. Defining JAAS Realms in a Fabric


Overview

Fabric containers, like standalone containers, use a special jaas:config element for defining JAAS realms. The difference is that when containers are deployed in a fabric, the JAAS realms need to be pushed out the fabric registry and all of the containers in the fabric need to share the same JAAS realms.

Procedure

To change the JAAS realm used by the fabric containers for authentication:
  1. Create a Maven project to package and deploy the JAAS realm to the fabric's Maven proxy as shown in the section called “Creating a Maven project for deploying a JAAS realm”.
  2. Create a JAAS realm that uses the LDAP login module:
    1. Open the blueprint XML file in src/main/resources/OSGI-INF/my-service.xml in a text editor.
    2. Delete the bean and service elements.
    3. Add a jaas:config element to the blueprint.
      See Section 6.1, “Defining JAAS Realms” for details on configuring the JAAS realm.
  3. Deploy the JAAS realm to the fabric's maven proxy using the mvn deploy command.
  4. In the management console create a new profile for deploying the new realm.
  5. Select the Bundles tab.
  6. Add the bundle you uploaded for the JAAS realm to the profile.
    Bundles are specified using Maven URLs. For example if your project's group ID is my.jaas.realm and the artifact ID is jaas, the Maven URL for the bundle will be mvn:my.jaas.realm/ldap/version.
  7. Add the new profile to all of the containers in the fabric.

Creating a Maven project for deploying a JAAS realm

To create a Maven project for deploying a JAAS realm to a fabric registry:
  1. Use the karaf-blueprint-archetype archetype to generate a template project.
    Example 7.2, “Create a Maven Project” shows how to invoke the archetype from the command line.

    Example 7.2. Create a Maven Project

    mvn archetype:generate -DarchetypeGroupId=org.apache.karaf.archetypes -DarchetypeArtifactId=karaf-blueprint-archetype -DgroupId=groupID -DartifactId=artifactID
  2. Remove the project's src/main/java folder.
    This folder holds template Java classes for implementing an OSGi service, but the JAAS realm does not require any Java classes.
  3. Open the project's POM in a text editor.
  4. Add a distributionManagement element, similar to the one shown in Example 7.3, “Fabric Maven Proxy Distribution Settings”, to the POM.

    Example 7.3. Fabric Maven Proxy Distribution Settings

    <distributionManagement>
      <repository>
        <id>fabric-maven-proxy</id>
        <name>FMC Maven Proxy</name>
        <url>http://username:password@localhost:8107/maven/upload/</url>
      </repository>
    </distributionManagement>
    You will need to modify the url element to include the connection details for your environment:
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.