ShinyApp - Dropbox authentication with rdrop2 - dropbox-api

I stored files on my dropbox and I am accessing them through rdrop2 on a shinyapp hosted at shinyapps.io. The following code works great on my laptop but aborts when I deploy my app on shinyapp.io and freezes an opaque screen. Any clues on why and how to troubleshoot? Thanks a bunch! - stephane
Here is the code I am using (from https://github.com/karthik/rdrop2):
token<-drop_auth()
saveRDS(token, "droptoken.rds")
token <- readRDS("droptoken.rds")
ZIPFile<-drop_read_csv(as.character(ZIPCode),sep="",dtoken=token)
And the ShinyApp log:
2015-10-16T17:55:46.965850+00:00 shinyapps[64206]: Warning: Unhandled error in observer: oauth_listener() needs an interactive environment.
2015-10-16T17:55:46.965853+00:00 shinyapps[64206]: observe({
2015-10-16T17:55:46.965854+00:00 shinyapps[64206]: if (input$Recalc < 1)
2015-10-16T17:55:46.965856+00:00 shinyapps[64206]: return()
2015-10-16T17:55:46.965857+00:00 shinyapps[64206]: ZIPCode <- isolate(input$NewZIP)
2015-10-16T17:55:46.965858+00:00 shinyapps[64206]: token <- drop_auth()
2015-10-16T17:55:46.965859+00:00 shinyapps[64206]: saveRDS(token, "droptoken.rds")
2015-10-16T17:55:46.965861+00:00 shinyapps[64206]: token <- readRDS("droptoken.rds")
2015-10-16T17:55:46.965862+00:00 shinyapps[64206]: ZIPFile <- drop_read_csv(as.character(ZIPCode), sep = "",
2015-10-16T17:55:46.965863+00:00 shinyapps[64206]: dtoken = token)

Problem solved: had a fresh look at the instructions provided by rdrop2:
The two first lines of code are to be done locally and once only:
token<-drop_auth() saveRDS(token, "droptoken.rds")
The file droptoken.rds is to be stored in the under the same folder structure than the one where the app is being developed.
The two last lines of code are to be kept in the app:
token<-drop_auth() saveRDS(token, "droptoken.rds")
This way when you deploy your app on a server, you're deploying also the token with it. Poses some security issues but I'll need to wait for a good set of instructions for oauth with dropbox under r.

Related

SPGO Error when trying to connect to SP On-Prem

I am new to SPGO and trying to use on SP On-Prem 2016 in a corp environment. I do not have to sign into SP but am authenticated via CAC. I chose NTLM but was prompted for my credentials so I don't know what the password is since I don't have to enter one. I then tried the "AddinOnly" method and was able to supply a client ID, entering "", secret: "", and realm: "". I did this by first registering an app and generating that info. That got me a little closer (or so it seemed). My workspace resides in C:\Users\myName\SPSites
SPGo.json setup:
{
"sourceDirectory": "src",
"sharePointSiteUrl": "https://fake.com/sitename/site",
"workspaceRoot": "c:\Users\myName\SPSites",
"publishWorkspaceOptions": {
"destinationFolder":"/",
"globPattern":"c:\Users\myName\SPSites\src*.",
"localRoot":"c:\Users\myName\SPSites\src"
},
"publishingScope": "SaveOnly",
"authenticationType": "AddinOnly",
"remoteFolders": [
"/siteassets/"
]
}
app permissions:
<AppPermissions AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl"/>
</AppPermissionRequests>
VSCodeVersion: 1.65.0
SP On-Prem: 2016
It says Starting File Synchronization when I try to populate workspace and it just hangs with Populating Workspace (bottom left) just spinning. Eventually I get an error about the workspace.
Also got this error, which is new: Output: syntax error: Unexpected token m in JSON at position 363. Might just be my typing. So I did populate workspace again and entered app credentials (client id, etc). It is now just hanging, Starting File Synchronization ... Populating Workspace

Application is active in server but page is not loading, shows err - Access denied

I was preparing production environment to deploy my ADF web application developed in jdeveloper 12.2.1. Installed and configured weblogic 12.2.1.1.0(latest version) and database( Oracle DB 11g) in different servers. I tired to deploy a simple demo application which worked smoothly. But when i tired to deploy my application with MDS enabled which also having login credentials it's not get loading. Application and servers(3 managed servers added in a cluster) are active and its health is fine.
While I checked the log i can found the error message as below:
weblogic.kernel.Default (self-tuning)'> <OracleSystemUser> <BEA1-00A6CDC0DF4E2399D225> <c21c09b7-a391-47ae-b2eb-0d8dc5bec343-00000d61> <1477317511991> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-010227> <EJB exception occurred during invocation from home or business: oracle.wsm.policymanager.bean.ejb.impl.UsageTracker_oi3aq7_Intf generated exception
: java.lang.SecurityException: WSM-02084 : Access denied. Permission "oracle.wsm.security.PolicyManagerPermission" is required to access the wsm policy manager "UsageTracker" method "recordUsage".>
I am stuck with this issues. Tried by starting and stopping servers and deploy and undeploy application many times.
Any help would be appreciable.
Thanks in advance.
You may want to check the suggestions on "SOA Suite 12.2.1 - OWSM WSM-02084 issue" from Michel Schildmeijer.
He suggests editing the policy.Accessor and adding oracle.wsm.security.PolicyManagerPermission for resource UsageTracker#recordUsage to the wsm-pm Application Stripe via "Fusion Middleware Control" under WebLogic Domain > Security > Application Policies.
https://community.oracle.com/blogs/mnemonic/2016/10/16/soa-suite-1221-owsm-wsm-02084-issue

LOAD Runner Internal server 500 issue (REST API)

I am trying to run REST API from Load Runner but unable to do it. Every times its throws below exception
Action.c(4): Error -26612: HTTP Status-Code=500 (Internal Server Error) for "http://ipaddress/LoyaltyApi/api1/loyaltycard/linkcard", Snapshot Info [MSH 1 1] [MsgId: MERR-26612]
My code :
Action()
{
lr_think_time(10);
web_custom_request("LinkCards",
"URL=http://ipaddress/LoyaltyApi/api1/loyaltycard/linkcard",
"Method=POST",
"Resource=0",
"EncType=application/json",
"Mode=HTTP",
"BodyFilePath=linkcards.json",
LAST);
return 0;
}
I have tested the same URL with POST parameter in POSTMAN and it's working fine without any issue.
I am very new in this technology so unable to solved the issue. Please help.
I am very new in this technology....
Assuming your management has moved you to this role, have they provided you with training on the tool and a mentor for a period of time. If not they have set you up for failure.

WSO2IS NullPointerException when using step authenticator

Occasionally (?) the WSO2 IS user is unable to authenticate with following exception. When retrying, the user will be authenticated. Any ideas what could be reason / resolution? We set up the session caching.
Using WSO2 Identity Server 5.0.0.SP1 / SAML authentication with the authenticator set to advanced (single step, multiple options). I cannot find the correct source code commit to check out (to match the line number in the exception)
Thank you all in advance
Gabriel
TID: [0] [IS] [2016-02-15 13:07:22,914] ERROR
{org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator}
- Exception in Authentication Framework {org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator}
java.lang.NullPointerException at
org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl.DefaultStepBasedSequenceHandler.handle(DefaultStepBasedSequenceHandler.java:83)
at
org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultAuthenticationRequestHandler.handle(DefaultAuthenticationRequestHandler.java:121)
at
org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator.handle(DefaultRequestCoordinator.java:94)
at
org.wso2.carbon.identity.application.authentication.framework.servlet.CommonAuthenticationServlet.doPost(CommonAuthenticationServlet.java:54)
at
org.wso2.carbon.identity.application.authentication.framework.servlet.CommonAuthenticationServlet.doGet(CommonAuthenticationServlet.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
Edit:
This exception occurs on the WSO2 IS 5.1.0 too
see the Source code line 105
StepConfig stepConfig = context.getSequenceConfig().getStepMap().get(currentStep);
// if the current step is completed
if (stepConfig.isCompleted()) {
stepConfig.setCompleted(false);
ERROR org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator} - Exception in Authentication Framework
java.lang.NullPointerException
at org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl.DefaultStepBasedSequenceHandler.handle(DefaultStepBasedSequenceHandler.java:105)
at org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultAuthenticationRequestHandler.handle(DefaultAuthenticationRequestHandler.java:115)
it looks like the stepConfig 'dissapeared' from the authentication config. The setup is done on a single node with session persistence into a database.
Apparently it looks like a problem with concurrency.
When multiple concurrent requests are sent to the SSO endpoint while the user is already authenticated, all threads are attempting to process the request modifying the same authentication context object (currentStep counter) so the cached authentication context comes to an invalid state.
Valid use case is that the client should send only a single request to the SSO endpoint, so the team dealing with the UI have to fix it. But - that's only the a quick fix not preventing the issue in long term. We have to really pick it up with WSO2 (and fix the code ourselves maybe) :)
g.

python social auth load strategy and authenticate user manually with release 0.1.26

I used python social auth for social authentication in the last 2 months and it was great.
I needed QQ support, hence installed newest git commit (23e4e289ec426732324af106c7c2e24efea34aeb - not part of a release).
until now i used to authenticate the user using the following code:
# setup redirect uri in order to load strategy
uri = redirect_uri = "social:complete"
if uri and not uri.startswith('/'):
uri = reverse(redirect_uri, args=(backend,))
# load the strategy
try:
strategy = load_strategy(
request=request, backend=backend,
redirect_uri=uri, **kwargs
)
strategy = load_strategy(request=bundle.request)
except MissingBackend:
raise ImmediateHttpResponse(HttpNotFound('Backend not found'))
# get the backend for the strategy
backend = strategy.backend
# check backend type and set token accordingly
if isinstance(backend, BaseOAuth1):
token = {
'oauth_token': bundle.data.get('access_token'),
'oauth_token_secret': bundle.data.get('access_token_secret'),
}
elif isinstance(backend, BaseOAuth2):
token = bundle.data.get('access_token')
else:
raise ImmediateHttpResponse(HttpBadRequest('Wrong backend type'))
# authenticate the user
user = strategy.backend.do_auth(token)
which worked fine.
In the latest release this behaviour has changed, and an exception is raised since the "load_strategy" method has changed.
I can't seem to find any documentation on how to do it with the new release.
Any help would be appreciated!
Omri.
The last changes in the repository changed the importance of the strategy, instead of being the main entity to perform the authentication, it's just a helper class to glue the framework with the backends. Try with this snippet to load the strategy and the backend:
from social.apps.django_app.utils import load_strategy, load_backend
strategy = load_strategy(request)
backend = load_backend(strategy, backend, uri)
...
user = backend.do_auth(token)