Skip to Content.
Sympa Menu

grouper-dev - custom operations in grouper client

Subject: Grouper Developers Forum

List archive

custom operations in grouper client


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Grouper Dev <>
  • Subject: custom operations in grouper client
  • Date: Sun, 25 Jan 2009 22:08:10 -0500
  • Accept-language: en-US
  • Acceptlanguage: en-US

Hey,

 

At Penn we will probably put some custom authorization/authentication operations in the grouper client.  The first will be a decode of tokens (then run an ldap operation on the result) from cosign, our new single signon system.  So now you can add whatever custom operations you want to the grouper client, if you want it to be a one stop shop for whatever you want.

 

https://bugs.internet2.edu/jira/browse/GRP-211

 


https://wiki.internet2.edu/confluence/display/GrouperWG/Grouper+Client

If you want the grouper client to execute custom Java operations, then follow these instructions. For example, at Penn we will have a couple of operations that decode Cosign single-signon tokens.

    * Put your code in grouperClientHome/src/custom (this is for the code which depends on ext or extCustom code, but nothing else)
    * If you have external code, put that in grouperClientHome/src/extCustom (this is for typically 3rd party code which might depend on other jars at compile time, but not runtime)
    * If you have jars for extCustom, but them in grouperClientHome/lib/custom
    * The class which responds to an operation should implement the interface: edu.internet2.middleware.grouperClient.ClientOperation
    * This has one method: public String operate(OperationParams operationParams);
    * Register this in the grouper.client.properties:

########################################
## Custom operations
## Implement the interface ClientOperation, put it in the jar
## Increment the int index for multiples (must be in order)
########################################

customOperation.name.0 = cosignDecode
customOperation.class.0 = edu.upenn.isc.grouperClient.CosignDecodeOperation

    * Implement the interface with the logic, and get params from the command line:

  /**
   * @see edu.internet2.middleware.grouperClient.ClientOperation#operate(edu.internet2.middleware.grouperClient.OperationParams)
   */
  public String operate(OperationParams operationParams) {
   
    Map<String, String> argMap = operationParams.getArgMap();
    Map<String, String> argMapNotUsed = operationParams.getArgMapNotUsed();
   
    //get params from command line
    String serviceName = GrouperClientUtils.argMapString(argMap, argMapNotUsed, "serviceName", true);
    String cookie = GrouperClientUtils.argMapString(argMap, argMapNotUsed, "cosignCookie", true);
   
    //get params from grouper.client.properties
    String keyStorePath = GrouperClientUtils.propertiesValue("cosign.keyStorePath", true);

    ... etc, execute the logic, and return the result which should be printed to screen or written to file

  

    * Build with: ant
    * Call the operation from the command line:

      C:\grouperClient\dist\institution\grouperClient.institution-1.4.0>java -jar grouperClient.jar --operation=cosignDecode --serviceName=cosign-isc-whatever-0 --cosignCookie=0mmN5ZwyJukNxxxxxxxxx
      203-PennNet ID mchyzer
      203-8-digit PennID 123456
      203-Timestamp 1111111111
      203 IP Address 1.2.3.4
      C:\grouperClient\dist\institution\grouperClient.institution-1.4.0>

 

Regards,

Chris

 



  • custom operations in grouper client, Chris Hyzer, 01/25/2009

Archive powered by MHonArc 2.6.16.

Top of Page