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 theOAuthServerKeyManager
interface. 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 class
OAuthServerKeyManagerImpl.InternalNuxeoOAuthConsumer
-
Field Summary
Fields Modifier and Type Field Description protected NuxeoOAuthConsumer
consumer
protected String
internalKey
protected String
internalSecret
protected ServerKeyDescriptor
serverKeyDescriptor
static String
XP_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 void
activate(ComponentContext context)
Activates the component.String
getBarePrivateKey()
Returns the Private Key used by Nuxeo server to do RSA Signing.String
getBarePublicCertificate()
Returns the Public Key certificate used by Nuxeo server to do RSA Signing.NuxeoOAuthConsumer
getInternalConsumer()
Returns theNuxeoOAuthConsumer
representing local (embedded) Shindig instance.String
getInternalKey()
Returns the consumerKey used in Shindig => Nuxeo sign fetch.String
getInternalSecret()
Returns the consumerSecret (HMAC) used in Shindig => Nuxeo sign fetch.String
getKeyName()
Returns key name (not really used).String
getPrivateKey()
Returns the Private Key used by Nuxeo server to do RSA Signing.String
getPublicKeyCertificate()
Returns the Public Key certificate used by Nuxeo server to do RSA Signing.void
registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
protected String
stripOpenSSL(String key)
void
unregisterContribution(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:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContribution
in classDefaultComponent
-
getPublicKeyCertificate
public String getPublicKeyCertificate()
Description copied from interface:OAuthServerKeyManager
Returns the Public Key certificate used by Nuxeo server to do RSA Signing.- Specified by:
getPublicKeyCertificate
in interfaceOAuthServerKeyManager
-
getBarePublicCertificate
public String getBarePublicCertificate()
Description copied from interface:OAuthServerKeyManager
Returns the Public Key certificate used by Nuxeo server to do RSA Signing. (Removes OpenSSL decorators).- Specified by:
getBarePublicCertificate
in interfaceOAuthServerKeyManager
-
getPrivateKey
public String getPrivateKey()
Description copied from interface:OAuthServerKeyManager
Returns the Private Key used by Nuxeo server to do RSA Signing.- Specified by:
getPrivateKey
in interfaceOAuthServerKeyManager
-
getBarePrivateKey
public String getBarePrivateKey()
Description copied from interface:OAuthServerKeyManager
Returns the Private Key used by Nuxeo server to do RSA Signing. (Removes OpenSSL decorators).- Specified by:
getBarePrivateKey
in interfaceOAuthServerKeyManager
-
getKeyName
public String getKeyName()
Description copied from interface:OAuthServerKeyManager
Returns key name (not really used).- Specified by:
getKeyName
in interfaceOAuthServerKeyManager
-
getInternalKey
public String getInternalKey()
Description copied from interface:OAuthServerKeyManager
Returns the consumerKey used in Shindig => Nuxeo sign fetch.- Specified by:
getInternalKey
in interfaceOAuthServerKeyManager
-
getInternalSecret
public String getInternalSecret()
Description copied from interface:OAuthServerKeyManager
Returns the consumerSecret (HMAC) used in Shindig => Nuxeo sign fetch.- Specified by:
getInternalSecret
in interfaceOAuthServerKeyManager
-
getInternalConsumer
public NuxeoOAuthConsumer getInternalConsumer()
Description copied from interface:OAuthServerKeyManager
Returns theNuxeoOAuthConsumer
representing local (embedded) Shindig instance.- Specified by:
getInternalConsumer
in interfaceOAuthServerKeyManager
-
-