1. Build the latest version of the code from the Github Pull request: https://github.com/apache/sling-whiteboard/pull/14
  2. Access the Google API console (Refer:  https://developers.google.com/identity/protocols/OpenIDConnect)
    1. Create a new set of Oauth ID client credentials
      1. Set the callbackURL to "http://localhost:8080/"
    2. Save the client id and client secret, you will need them for the next step
  3. Add the following provisioning model file to your application, e.g. for the Sling Starter application and rebuild it, at src/main/provisioning/oidc.txt:

    oidc.txt
    #
    #  Licensed to the Apache Software Foundation (ASF) under one
    #  or more contributor license agreements.  See the NOTICE file
    #  distributed with this work for additional information
    #  regarding copyright ownership.  The ASF licenses this file
    #  to you under the Apache License, Version 2.0 (the
    #  "License"); you may not use this file except in compliance
    #  with the License.  You may obtain a copy of the License at
    #
    #   http://www.apache.org/licenses/LICENSE-2.0
    #
    #  Unless required by applicable law or agreed to in writing,
    #  software distributed under the License is distributed on an
    #  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    #  KIND, either express or implied.  See the License for the
    #  specific language governing permissions and limitations
    #  under the License.
    #
    #
    [feature name=oidc]
    
    [artifacts]
        net.minidev/accessors-smart/1.2
        net.minidev/json-smart/2.3
        com.nimbusds/nimbus-jose-jwt/5.14
        com.nimbusds/lang-tag/1.4.3
        com.nimbusds/oauth2-oidc-sdk/5.62
        org.ow2.asm/asm/5.2
        org.apache.servicemix.bundles/org.apache.servicemix.bundles.jcip-annotations/1.0_2
        org.apache.sling/org.apache.sling.auth.oidc.core/1.0.0-SNAPSHOT
    
    [configurations]
        org.apache.sling.oidchandler.core.configuration.OIDCConfigServlet
            clientid.string="YOUR-CLIENT-ID"
            clientsecret.password="YOUR-CLIENT-SECRET"
    
      org.apache.sling.jcr.base.internal.LoginAdminWhitelist.fragment-oidc
        whitelist.name="oidc"
        whitelist.bundles=[
          "org.apache.sling.jcr.api"
        ]
  4. Build Sling and start the server
  5. Go to http://localhost:8080/auth/login
  6. Then you will be redirected to Google login page. Give your credentials and consent when required.
  7. If the authentication is successful you will be successfully logged in to Sling.
  • No labels