Unauthorized Orbeon Form Error - orbeon

I am using orbeon xform engine as a separate deployment with my Java Application. I followed all the steps required for separate deployment but while implementing xfroms using Orbeon I am getting following error:
"Orbeon Forms - Unauthorized
You do not have access to this page."
Inside tomcat orbeon log file it is showing following error:
392 INFO ProcessorService - Context listener - Context initialized.
522 INFO ProcessorService - Servlet initialized.
724 INFO ProcessorService - /xforms-renderer - Received request
192 INFO PageFlowControllerProcessor - unauthorized {controller: "oxf:/ops/xforms/xforms-renderer-page-flow.xml", method: "POST", path: "/xforms-renderer", status-code: "403"}
205 INFO ProcessorService - /xforms-renderer - Timing: 2465
I used RequestDispatcher in my servlet to forward my request for required XForm
ServletContext context= getServletContext();
RequestDispatcher rd= context.getRequestDispatcher("/xforms-jsp/orbeon/form.jsp");
rd.forward(request, response);
I am able to render xfrom while implementing as a integrated deployment.
May you guide where I am getting wrong.
Thanks!

If you're using separate deployment, you should be using the Orbeon servlet filter in your web.xml, and you don't need to use a RequestDispatcher in your own code. I double-checked this now with 4.0 to verify it works. (I am wondering what led you to believe that you needed to use your own RequestDispatcher, as I don't see anything about this in the separate deployment documentation.)
Note however that because of this issue, for now you also need to add the orbeon class on the <body> of your HTML, otherwise the proper styles won't apply. This is just temporary, and the class will be added automatically for you when this issue is fixed.

Related

404 not found with api call - Angular to RoR

I am a newbie with Ruby on Rails and I am trying to figure out ways to connect Angular to RoR in a very simple way
Here is my service
mWebApp.service('mWebSrvc', function($http, $log) {
this.getCustomers = function() {
$http({
method : 'GET',
url : 'http://127.0.0.1:3000/api/customers/'
}).success(function(data, status, headers, config) {
$log.log('Done');
angular.forEach(data, function(c) {
$log.log(c.Title);
});
customers = data;
return customers;
});
};
});
When I look under the Net tab in Firebug, I see OPTIONS /api/customers/ 404 Not Found, but if I click on the Response tab within, then I see the JSON file - WTF? And not the JSON tab - again, WTF?
Under Firebug's console -
"NetworkError: 404 Not Found - http://numberForLocalHost:3000/api/customers/"
My Rails server is running in daemon mode - numberForLocalHost:3000 - is this what the issue might be? That it should be calling a true api
If I paste the URL above into any web browser, then I can see the JSON
As usual, thanks in advance
You're getting an OPTIONS request because your browser believes this is a cross origin request.
See this question for example. Is your RoR app also serving your client side angular? If not, you should decide whether it can be (there shouldn't be a reason not to), or you need to reply to the pre-flight OPTIONS request from your server that you are seeing.
I had the very same issue with my Rails + Angular app. I had my cors well set up in my rails app but still nothing, I still got a 404 not found in the angular app. This could be the reason:
Perhaps you have "angular-in-memory-web-api": '0.x.x' in your package.json and also imported in your app.module.ts, as InMemoryWebApiModule and InMemoryDataService. These apparently intercept all calls to an API preventing them from ever reaching your back-end server. When I Removed those dependencies and their declarations, all of a sudden my app started working normally!
Look at this answer for more information.

AccessTokenAuthorizationCodeRequestC "error":"invalid_request"

At the second call to Client.ProcessUserAuthorization(); after I get the code from the oauth server, I get an exception: Error occurred while sending a direct message or getting the response.
Here is the last part from the log file taken with log4net, the full log is recorded in this gist: https://gist.github.com/tonyeung/5513769
2013-05-03 15:14:41,292 (GMT-5) [10] DEBUG DotNetOpenAuth.Messaging.Channel - Sending AccessTokenAuthorizationCodeRequestC request.
2013-05-03 15:14:41,393 (GMT-5) [10] DEBUG DotNetOpenAuth.Http - HTTP POST http://localhost:38828/OAuth/Token
2013-05-03 15:14:41,450 (GMT-5) [10] ERROR DotNetOpenAuth.Http - http://localhost:38828/OAuth/Token returned 400 BadRequest: Bad Request
2013-05-03 15:14:41,450 (GMT-5) [10] DEBUG DotNetOpenAuth.Http - WebException from http://localhost:38828/OAuth/Token:
{"error":"invalid_request"}
I've uploaded the solution to https://github.com/tonyeung/dotnetopenauth
The entry point is in the about action on the home controller of the Client project.
The solution is in VS2012, the latest nuget dnoa package. Nuget restore is on.
Please note that I'm implementing pieces as I need them in order to understand how the library works. I'm sure that this error is due to a missing implementation somewhere, but I'm not sure what it is?
So it looks like I was missing implementations for IsAuthorizationValid and CreateAccessToken in the Authorization Server. Please check the github repository for the stubs i put in that makes the error go away.
EDIT:
There was also a database validation error that I didn't trap. So basically any error on the server side will cause this message it looks like.
EDIT2:
There was also an issue where if the url of the page contains any non url encoded values it will throw an invalid request. In my case, my login page had a querystring parameter of returnUrl, and I had set it to /Home, which it DID NOT like, had to be: %2FHome

Grails request object null in Jetty 8.1

The following code works as expected on Grails 2.0.4 and Eclipse STS 3.2 using Eclipse's embedded tcServer 2.7 as the web container...
class TestController {
def service() {
println request.request.getRequestURL()
//render response here...
}
For a client request of http://svr1:8080/testapp/test/node1, the above code prints the full request URL, http://svr1:8080/testapp/test/node1.
We created a WAR and deployed it to Jetty 8.1.10, but found that request.request returns null, so the above code fails with a null pointer. We tried using request.getRequestURL() but it returns a URL containing grails dispatch syntax, so it does not match the original client request url which is what we need.
As a workaround, we manually constructed most of the URL using request.getServerName(), request.getServerPort(), and request.getContextPath(), giving http://svr1:8080/testapp, but that still leaves out the uri portion, /test/node1. We assume this problem may be attributed to Jetty's Servlet API implementation, but if that were the case surely someone else would have picked up on this before us.
Found a workaround that appears to work on tcServer and Jetty posted here. We construct the base URL manually, then use this utility to get the remaining portion.

GRAILS: Inconsistent handling of 500 status code on seperate WebLogic 10.3 instances

I've got a simple Grails app (1.3.7) in which I'm testing exceptions and returning specific HTTP status codes to the client.
I've disabled the default "500" (view: '/error') in URLMappings to prevent Grails from rendering the response using the standard error view.
I've got a simple closure in my controller to which I redirect, after catching an exception, and render the response...
def remoteError = {
response.status = 500
render ([__error: "A remote error occurred"] as JSON)
}
On one instance of WebLogic 10.3, when the test exception is thrown, the response is as follows...
{
__error: "A remote error occurred"
}
..exactly what I expected.
But the same exact WAR file deployed to another WebLogic 10.3 instance produces the standard Grails error page, seen below. Since the WAR file did not change, I'm trying to figure out what setting in WebLogic is causing this to behave differently compared to the other instance.
Turns out this problem was related to a missing plugin in our deployment WAR. On one instance of WebLogic, the plugin was in the maven/ivy cache, but on the other it was not, and this is why the WAR appeared to behave differently.

Getting the username in Twitter using OAuth 0.1.1 Grails plugin

anyone had tried using http://www.grails.org/plugin/oauth? i'm trying it in twitter.com and i'm having an issue on getting the username or accessing this API: http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-account%C2%A0verify_credentials
here's the code in my callback URL:
def twitterCallback = {
def response = oauthService.accessResource('http://api.twitter.com/1/account/verify_credentials.json','twitter', session.oauthToken)
log.debug "response: ${response}"
}
i keep getting this error:
2010-04-22 14:32:56,842 [http-8081-1]
WARN httpclient.HttpMethodBase -
Cookie rejected: "$Version=0;
_twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCMQcOCQoAToHaWQiJThiYWY4MGI1YTY1M2U0%250AYTRhNjAzYTA2NTBmNjkzZTYwIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--31d191141bf32e0489967492692f1e77fc9e1845;
$Path=/; $Domain=.twitter.com".
Illegal domain attribute
".twitter.com". Domain of origin:
"twitter.com" 2010-04-22 14:32:56,854
[http-8081-1] INFO
auth.AuthChallengeProcessor - basic
authentication scheme selected
2010-04-22 14:32:56,856 [http-8081-1]
INFO httpclient.HttpMethodDirector -
No credentials available for BASIC
'Twitter API'#twitter.com:80
2010-04-22 14:32:56,865 [http-8081-1]
ERROR errors.GrailsExceptionResolver
- null
it seems that it uses BASIC authentication instead of OAuth. any ideas? or is there an issue in the OAuth Grails plugin?
thanks.

Resources