mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix ALF-10402: PUB: Access tokens are not being stored in encrypted properties
- NOTE: this fix means that any existing publishing channels in the repo will cease to work and will cause the publishing generally to have problems. If you have publishing channels in your repo then you must remove them following this fix. This can be done by either cleaning your repo out completely or deleting the node underneath "Data Dictionary/Publishing Root" (it has a UUID as its name). git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30646 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.publishing.flickr;
|
||||
|
||||
import org.alfresco.repo.node.encryption.MetadataEncryptor;
|
||||
import org.alfresco.repo.publishing.PublishingModel;
|
||||
import org.alfresco.repo.publishing.flickr.springsocial.api.Flickr;
|
||||
import org.alfresco.repo.publishing.flickr.springsocial.connect.FlickrConnectionFactory;
|
||||
@@ -30,6 +31,7 @@ public class FlickrPublishingHelper
|
||||
{
|
||||
private NodeService nodeService;
|
||||
private FlickrConnectionFactory connectionFactory;
|
||||
private MetadataEncryptor encryptor;
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
@@ -41,6 +43,11 @@ public class FlickrPublishingHelper
|
||||
this.connectionFactory = connectionFactory;
|
||||
}
|
||||
|
||||
public void setEncryptor(MetadataEncryptor encryptor)
|
||||
{
|
||||
this.encryptor = encryptor;
|
||||
}
|
||||
|
||||
public FlickrConnectionFactory getConnectionFactory()
|
||||
{
|
||||
return connectionFactory;
|
||||
@@ -53,8 +60,10 @@ public class FlickrPublishingHelper
|
||||
if (nodeService.exists(channelNode)
|
||||
&& nodeService.hasAspect(channelNode, PublishingModel.ASPECT_OAUTH1_DELIVERY_CHANNEL))
|
||||
{
|
||||
String tokenValue = (String) nodeService.getProperty(channelNode, PublishingModel.PROP_OAUTH1_TOKEN_VALUE);
|
||||
String tokenSecret = (String) nodeService.getProperty(channelNode, PublishingModel.PROP_OAUTH1_TOKEN_SECRET);
|
||||
String tokenValue = (String) encryptor.decrypt(PublishingModel.PROP_OAUTH1_TOKEN_VALUE, nodeService
|
||||
.getProperty(channelNode, PublishingModel.PROP_OAUTH1_TOKEN_VALUE));
|
||||
String tokenSecret = (String) encryptor.decrypt(PublishingModel.PROP_OAUTH1_TOKEN_SECRET, nodeService
|
||||
.getProperty(channelNode, PublishingModel.PROP_OAUTH1_TOKEN_SECRET));
|
||||
Boolean danceComplete = (Boolean) nodeService.getProperty(channelNode, PublishingModel.PROP_AUTHORISATION_COMPLETE);
|
||||
|
||||
if (danceComplete)
|
||||
|
Reference in New Issue
Block a user