GithubHelp home page GithubHelp logo

curityio / kong-dev-portal-user-provisioner Goto Github PK

View Code? Open in Web Editor NEW
1.0 6.0 1.0 74 KB

Authentication Action that creates a Dev Portal User in Kong

Home Page: https://curity.io/resources/learn/provision-kong-dev-portal-user/

License: Apache License 2.0

Java 100.00%
authentication-action kong dev-portal plugin user-provisioning

kong-dev-portal-user-provisioner's Introduction

Kong Dev Portal User Provisioner Action

Quality Availability

A custom authentication action plugin for the Curity Identity Server that automates the provisioning of a user to the Kong Dev Portal.

System Requirements

The plugin is tested with the Curity Identity Server 8.3.1, but should work with older version also. More details in the Systems Requirement section of the product documentation.

Building the Plugin

You can build the plugin by issuing the command mvn package. This will produce JAR file(s) in the target directory, which can be installed.

Installing the Plugin

To install the plugin, copy the compiled JAR (and all of its dependencies) into the :file:${IDSVR_HOME}/usr/share/plugins/${pluginGroup} on each node, including the admin node. For more information about installing plugins, refer to the Product Documentation.

Configuration

There are only two configuration parameters:

  1. An Http Client is needed. This will be used as the client to communicate with the Kong Dev Portal API. By default the HTTP Authentication of the Http Client can be left as-is. The scheme (http/https) needs to match the Kong dev Portal URL (Se next config parameter).
  2. The Kong Dev Portal URL needs to be set. This is the host that the Kong Dev Portal is running on and by default uses the /register endpoint.

Configure Action

How does it work?

The plugin needs to pass two attributes in order to successfully register a user in the Kong Dev Portal, the users full name and the email address. The payload that the plugin sends to register the user looks like this:

{
    "email": "[email protected]", 
    "meta": "{\"full_name\": \"Bob Builder\"}"
}

The plugin is currently operating with the Curity Identity Server default account table schema in order to resolve the information needed. The email is readily available in a column. The full name of the user is not, however. The default schema of the column containing first and last name is the attributes column and contains a JSON blob.

{"emails":[{"value":"[email protected]","primary":true}],"phoneNumbers":[{"value":"555-123-1234","primary":true}],"name":{"givenName":"alice","familyName":"anderson"},"agreeToTerms":"on","urn:se:curity:scim:2.0:Devices":[]}

The plugin will parse this structure in order to send the full name in the provisioning call to the Kong Dev Portal API.

More Information

Please visit curity.io for more information about the Curity Identity Server.

kong-dev-portal-user-provisioner's People

Contributors

iggbom avatar mtrojanowski avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar Travis Spencer avatar  avatar  avatar  avatar

Forkers

drokine

kong-dev-portal-user-provisioner's Issues

Cannot install this plugin on latest curity

Hi, I've received these error messages while trying install kong dev portal plugin in Curity

curity  | openjdk version "17.0.6.0.101" 2023-04-18 LTS
curity  | OpenJDK Runtime Environment Zulu17.41+14-SA (build 17.0.6.0.101+2-LTS)
curity  | OpenJDK 64-Bit Server VM Zulu17.41+14-SA (build 17.0.6.0.101+2-LTS, mixed mode)
curity  | 2023-08-11T02:54:39:239+0000 INFO    {main} se.curity.identityserver.app.LogInitializer - Using log4j config: XmlConfiguration[location=/opt/idsvr/etc/log4j2.xml]
curity  | 2023-08-11T02:54:39:244+0000 INFO    {main} se.curity.identityserver.app.Bootstrapper - Using default key for configuration encryption
curity  | 2023-08-11T02:54:39:566+0000 INFO    {server-start-stop-1} se.curity.identityserver.jetty.AppServer.node-status-server - Starting HTTP server (run 1)
curity  | 2023-08-11T02:54:39:585+0000 INFO    {main} se.curity.identityserver.app.Bootstrapper - Identity Server version 8.3.2
curity  | 2023-08-11T02:54:39:646+0000 WARN    {main} se.curity.identityserver.app.Bootstrapper - Caught an unhandled exception loading plug-ins
curity  | se.curity.identityserver.prebooter.PluginBuildException: Failed to update plugin group 'kong'
curity  | 	at se.curity.identityserver.prebooter.PluginGroupManager.compileAndUpdatePluginGroup(PluginGroupManager.kt:177) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at se.curity.identityserver.prebooter.PluginGroupManager.compileAndUpdateAllPluginGroups(PluginGroupManager.kt:114) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at se.curity.identityserver.prebooter.PluginInitializer$initializePlugins$compiledPlugins$1.invoke(PluginInitializer.kt:39) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at se.curity.identityserver.prebooter.PluginInitializer$initializePlugins$compiledPlugins$1.invoke(PluginInitializer.kt:38) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:315) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
curity  | 	at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
curity  | 	at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:786) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
curity  | 	at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:816) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
curity  | 	at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:807) ~[kotlin-stdlib-1.6.10.jar:1.6.10-release-923(1.6.10)]
curity  | 	at se.curity.identityserver.prebooter.PluginInitializer.initializePlugins(PluginInitializer.kt:40) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at se.curity.identityserver.prebooter.PreBooter.runPrebooter(PreBooter.kt:36) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at se.curity.identityserver.app.Bootstrapper.main(Bootstrapper.java:255) ~[identityserver.host-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at se.curity.identityserver.app.Bootstrapper.main(Bootstrapper.java:107) ~[identityserver.host-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | Caused by: java.lang.IllegalArgumentException: The /opt/idsvr/usr/share/plugins/kong/slf4j-api-1.7.36.jar file provides the slf4j.api library with version 1.7.36, but the server only supports version 2.0.3. Please change the version of this library the plugin is compiled with.
curity  | 	at se.curity.identityserver.prebooter.loader.PluginClassLoaderFactoryKt.validateAndFilterJars(PluginClassLoaderFactory.kt:124) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at se.curity.identityserver.prebooter.loader.PluginClassLoader.<init>(PluginClassLoader.kt:55) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at se.curity.identityserver.prebooter.loader.PluginClassLoaderFactory.apply(PluginClassLoaderFactory.kt:77) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at se.curity.identityserver.prebooter.PluginGroupManager.compilePluginsInGroup(PluginGroupManager.kt:184) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	at se.curity.identityserver.prebooter.PluginGroupManager.compileAndUpdatePluginGroup(PluginGroupManager.kt:164) ~[identityserver.yang-generator-8.3.2-70cbd834f8.jar:8.3.2-70cbd834f8]
curity  | 	... 12 more
curity  | 2023-08-11T02:54:39:646+0000 INFO    {main} se.curity.identityserver.app.DelegatableShutdownSwitch - Server being shutdown by switch called 'plugin-loader'

I noticed, according to the doc, this plugin only supports Curity 6.0 and below, does it mean the latest Curity is not supported?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.