Retrieve access from Request Connector in Mule Anypoint Studio - http

I want to store the access token value from request connector separately in variable.
can some one help on it.
using Oauth module 1.1

You can use the <oauth:retrieve-access-token> operation to get the token from the the token manager.
Example:
<oauth:retrieve-access-token tokenManager="tokenManagerConfig" target="accessToken"/>
I recommend to upgrade the module to the latest version available to get bug fixes. 1.1.0 is an old version by now.

Related

RavenDb patch api in embedded version of the server

Is there any difference in patch api in embedded and standard version of the server?
Is there a need to configure document store in some way to enable patch api?
I'm writing a test which use embedded raven. The code works correctly on the standard version but in test it doesn't. I'm constantly receiving patch result: DocumentDoesNotExists. I`ve checked with debugger and the document exists in the store - so it is not a problem with test.
Here you can find a repro of my issue: https://gist.github.com/pblachut/c2e0e227fa3beb51f4f9403505c292bb
I`ve reached the contact in the ravendb support and I have answer for my question.
There should be no difference between embedded and normal version of the server. The problem was that I did not passed explicitly for which database I want to invoke batch command. In the result I tried to patch document in system database.
var result = await documentStore.AsyncDatabaseCommands.ForDatabase("testDb).BatchAsync(new[] {command});
I assumed that database name will be taken from the session (beacuse I get documentStore from there). But the name of database should be always passed.
var documentStore = session.Advanced.DocumentStore;

Route.DeserializationResult return MAP_VERSION_MISMATCH

I Serialize the route with my android app and send to another device and use the same android app to Deserialize it, only got MAP_VERSION_MISMATCH.
Actually the here map SDK are the same... the same app, why...
Because the map version is different. Routes must be using the same map version for it to be serializable / deserializable.
As per the documentation:
"Map version from serialized route does not match current map version."
Please use the MapLoader APIs to update to the latest map for both.

How to sending api payload content to bam

I'm using Api Manager Version 1.7.0 and BAM Version 4.2.0: installing API_Manager_Analytics toolbox I have any field values predefined (e.g payload_api, payload_apiPublisher etc...); For the requests I see them in Cassandra DB under EVENT_KS org_wso2_apimgt_statistics_request: how do I get the field values of the requests used to invoke the apis in org_wso2_apimgt_statistics_request? how do I pass the soap body payload content to BAM? Tks Gius
you can write custom data publisher as mentioned here[1] or you can use bam mediator[2] and publish in to separate stream
1.https://nadeesha678.wordpress.com/2015/12/14/how-to-publish-custom-set-of-data-from-api-manager-to-wso2-business-activity-monitor/
2.https://docs.wso2.com/display/ESB481/BAM+Mediator

Work around in RGoogleDocs with two-step verification?

I try to use RGoogleDocs and get
Error: Forbidden
I have two-step verification on: is there a work-around?
sheets.con = getGoogleDocsConnection(getGoogleAuth(user, ps, service = "wise"))
Error: Forbidden
Relevant question
The getGoogleAuth of RGoogleDocs package is based on an officially deprecated ClientLogin to connect google server, see https://developers.google.com/identity/protocols/AuthForInstalledApps?csw=1
You may use the application password of google as a try.
Another way is just use the url of you google docs to visit certain contents, see http://www.r-bloggers.com/access-google-spreadsheet-directly-in-bash-and-in-r/
Update:
In the source code of getGoogleAuth, the author used an application called 'R-GoogleDocs-0.1', you may apply an new application and get the token. Then I think you could use the token and the api from google to access google docs directly in R. However, such hacks almost mean update/rewrite RGoogleDocs package.

rmongodb support for MongoDB 3

I am building a R script in which I need to connect to MongoDB through authentication and process the data fetched from database using rmongodb package.For that I have created a new MongoDB user in version 3.0.4 and while connecting to mongoDB from R script authentication fails.
Also the user is authenticated successfully through mongo shell.
Also authentication works fine while I authenticate user created in MongoDB version 2.x.
Following is code snippet which we have used in R script to connect to Mongo database.
mongo <- mongo.create("127.0.0.1", "", "user", "pass", "db", 0L )
While executing above code snippet we receive the following response
error: Loading required package: rmongodb Authentication failed.
Please suggest me appropriate solution to authentication failure issue in rmongodb package.
rmongodb (as at 1.8.0) uses a legacy MongoDB C driver which doesn't have full support for MongoDB 3.0 yet. In particular, it will not support using the new SCRAM-SHA-1 default authentication or optional WiredTiger storage engine.
There's an rmongodb issue in Github tracking this: Compatibility with version 3.0 of MongoDB.
Until rmongodb is updated your options (in order of least to most hasslesome) include:
use a different driver which does have MongoDB 3.x support (i.e. RMongo 0.1.0 or newer)
use MongoDB 2.6
use MongoDB 3.x but downgrade to the older MONGO-CR auth (and do not use WiredTiger or any alternative storage engines)
Having just gone through this myself, I thought I'd add my two cents in case it helps someone.
#Stennie is right on target to with the authentication stuff. So if you want to use mongo 3 the way to get it going is as follows (this is from a ubuntu install).
1) sudo nano /etc/mongod.conf
2) Comment out the "auth=TRUE" line
3) sudo service mongod restart
4) login to mongo shell (now with no authentication so everything is open)
5) use admin
6) Execute the following:
var schema = db.system.version.findOne({"_id" : "authSchema"})
schema.currentVersion = 3
db.system.version.save(schema)
(the above 3 commands are from here: https://jira.mongodb.org/browse/SERVER-17459)
7) create your users in the appropriate database
8) to make sure the right credentials are set up, type db.system.users.find() and amke sure they have the MONGODB-CR credentials
9) quit mongo
10) ucomment out the authentication line in /etc/mongod.conf
11) restart mongodb using sudo service mongod restart
should work now! I hope that helps someone...

Resources