Class OAuthServerKeyManagerImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.oauth.keys.OAuthServerKeyManagerImpl
-
- All Implemented Interfaces:
OAuthServerKeyManager,Adaptable,Component,Extensible,TimestampedService
public class OAuthServerKeyManagerImpl extends DefaultComponent implements OAuthServerKeyManager
Implements theOAuthServerKeyManagerinterface. Manages an extention point to configure RSA Key Pair. Shindig/Nuxeo HMAC shared secret is dynamically generated at startup time (and shared between Nuxeo OAUth Filter and Shindig directly in memory).- Author:
- tiry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classOAuthServerKeyManagerImpl.InternalNuxeoOAuthConsumer
-
Field Summary
Fields Modifier and Type Field Description protected NuxeoOAuthConsumerconsumerprotected StringinternalKeyprotected StringinternalSecretprotected ServerKeyDescriptorserverKeyDescriptorstatic StringXP_SERVER_KEY-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description OAuthServerKeyManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(ComponentContext context)Activates the component.StringgetBarePrivateKey()Returns the Private Key used by Nuxeo server to do RSA Signing.StringgetBarePublicCertificate()Returns the Public Key certificate used by Nuxeo server to do RSA Signing.NuxeoOAuthConsumergetInternalConsumer()Returns theNuxeoOAuthConsumerrepresenting local (embedded) Shindig instance.StringgetInternalKey()Returns the consumerKey used in Shindig => Nuxeo sign fetch.StringgetInternalSecret()Returns the consumerSecret (HMAC) used in Shindig => Nuxeo sign fetch.StringgetKeyName()Returns key name (not really used).StringgetPrivateKey()Returns the Private Key used by Nuxeo server to do RSA Signing.StringgetPublicKeyCertificate()Returns the Public Key certificate used by Nuxeo server to do RSA Signing.voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)protected StringstripOpenSSL(String key)voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
serverKeyDescriptor
protected ServerKeyDescriptor serverKeyDescriptor
-
XP_SERVER_KEY
public static final String XP_SERVER_KEY
- See Also:
- Constant Field Values
-
consumer
protected NuxeoOAuthConsumer consumer
-
internalKey
protected String internalKey
-
internalSecret
protected String internalSecret
-
-
Method Detail
-
activate
public void activate(ComponentContext context)
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContributionin classDefaultComponent
-
getPublicKeyCertificate
public String getPublicKeyCertificate()
Description copied from interface:OAuthServerKeyManagerReturns the Public Key certificate used by Nuxeo server to do RSA Signing.- Specified by:
getPublicKeyCertificatein interfaceOAuthServerKeyManager
-
getBarePublicCertificate
public String getBarePublicCertificate()
Description copied from interface:OAuthServerKeyManagerReturns the Public Key certificate used by Nuxeo server to do RSA Signing. (Removes OpenSSL decorators).- Specified by:
getBarePublicCertificatein interfaceOAuthServerKeyManager
-
getPrivateKey
public String getPrivateKey()
Description copied from interface:OAuthServerKeyManagerReturns the Private Key used by Nuxeo server to do RSA Signing.- Specified by:
getPrivateKeyin interfaceOAuthServerKeyManager
-
getBarePrivateKey
public String getBarePrivateKey()
Description copied from interface:OAuthServerKeyManagerReturns the Private Key used by Nuxeo server to do RSA Signing. (Removes OpenSSL decorators).- Specified by:
getBarePrivateKeyin interfaceOAuthServerKeyManager
-
getKeyName
public String getKeyName()
Description copied from interface:OAuthServerKeyManagerReturns key name (not really used).- Specified by:
getKeyNamein interfaceOAuthServerKeyManager
-
getInternalKey
public String getInternalKey()
Description copied from interface:OAuthServerKeyManagerReturns the consumerKey used in Shindig => Nuxeo sign fetch.- Specified by:
getInternalKeyin interfaceOAuthServerKeyManager
-
getInternalSecret
public String getInternalSecret()
Description copied from interface:OAuthServerKeyManagerReturns the consumerSecret (HMAC) used in Shindig => Nuxeo sign fetch.- Specified by:
getInternalSecretin interfaceOAuthServerKeyManager
-
getInternalConsumer
public NuxeoOAuthConsumer getInternalConsumer()
Description copied from interface:OAuthServerKeyManagerReturns theNuxeoOAuthConsumerrepresenting local (embedded) Shindig instance.- Specified by:
getInternalConsumerin interfaceOAuthServerKeyManager
-
-