How to pass other data with j_security_check? - websphere-6.1

I use IBM Websphere Application Server 6.1 and my login screen have controls as:
<form action="j_security_check" method="POST">
User Name: [ Admin ] <<-- j_username
Password: [ ******* ] <<-- j_password
Operation Date: [ 10/Nov/2011 ] <<---txtOperDate
[Login] [Cancel]
</form>
How to get Operation Date value in other pages after authentication with j_security_check?
Thanks

It's better to send that parameter along with Cookies in header. Than inside j_security_form.
Thanks
J

Related

Can I use a friendly URL on SearchAction?

My current URL for searches is this one:
https://example.com/search/key/seach_word_here
JSON-LD
<script type='application/ld+json'>
[
{
"#context":"http:\/\/schema.org",
"#type":"WebSite",
"#id":"#website",
"url":"https://example.com",
"name":"Example",
"potentialAction":{
"#type":"SearchAction",
"target":"https:https://example.com/search/key/{search_term_string}",
"query-input":"required name=search_term_string"
}
},
{
"#context":"http:\/\/schema.org",
"#type":"Organization",
"url": "https://example.com",
"name": "Example",
"logo":"https://example.com/img/logo.png",
"#id":"#organization",
"sameAs": ["https://www.facebook.com/example"]
}
]
</script>
As you can see I'm using a friendly URL on the target.
I have seen people using a query string on the URL like this:
https://example.com/?search={search_term_string}
I did not see people using a friendly URL on the target. It's not allowed?
And at https://developers.google.com/search/docs/data-types/sitelinks-searchbox it says:
Verify your search engine implementation by copying the WebSite.potentialAction.target URL from your structured data, replacing search_term_string with a test query, and browsing to that URL in a web browser. For example, if your website is example.com, and you want to test the query "kittens", you would browse to https://www.example.com/search/?q={kittens}.
I tested this url https://example.com/search/hey/{search_word_here} and I got a 404 not found, but this URL worked: https://example.com/?p=search&tp=key&word={search_word_here}.
So my question is: Can I use a friendly URL on the target? And the code on my snippet is correct?
Of course you have to use the URL that works.
Google will use the target URL for their Sitelink Searchbox, so that users can search on Google’s SERP and end up on your internal SERP. If you specify a target URL that leads to 404 pages, having this feature makes no sense, and Google would have no interest to enable it for your results.
If that URL happens to be friendly (e.g., without a query component), so be it.
Agree with above solution from #unor, now answering about you code correction
Please check the target url in posted JSON-LD:-
"target":"https:https://example.com/search/key/{search_term_string}",
Remove the double https:
Also in case of JSON-LD: you cannot map name value to /{search_term_string}
A correct way is always like this:-
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "WebSite",
"url": "[website url]",
"potentialAction": {
"#type": "SearchAction",
"target": "[website search url]={search_term}",
"query-input": "required name=search_term"
}
}
</script>
Microdata:-
<div itemscope itemtype="http://schema.org/WebSite">
<meta itemprop="url" content="[website url]"/>
<form itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction">
<meta itemprop="target" content="[website search url]={search_term}"/>
<input itemprop="query-input" type="text" name="search_term">
<input type="submit">
</form>
</div>

create an identity that can issue other identities in hyperledger composer rest server

I checked that link and that there is an option --issuer or -x but what if I want to create an issuer identity from composer rest server ?
what are possible values that can be passed to that "options" field in the body of issue system identity request in the rest server ?
Under /System;
POST /system/identities/issue:
{ "participant": "resource:org.acme.mynetwork.BizAdmin#org1admin",
"userID": "jdoe", "options": {"issuer" : true} }
in the JSON data for the request.

Pre-setting values to Docusign template

I am new to Docusign api and I am trying to post values from my form into a template. To be honest, I am not sure if I even created the custom fields properly or if there is some special way to set them into the form other than just creating a text field with a name.
I have read through the docs and recipes and about a dozen or more stack posts.
I am using rails and my fields post just fine but it's my tabs that do not. I read somewhere that I am supposed to use tabs and not custom_fields. Not sure if that's totally correct but that's how I've interpreted it.
Here is my current code:
body: {
"emailSubject": "DocuSign API call - Request Signature - Boom",
"templateId": "e1d5bce1-9757-4ffe-881b-054aa9139f2f",
"templateRoles": [{
"email": "#{renter.email}",
"name": "#{renter.background.legal_name}",
"roleName": "Lessee"
},{
"email": "#{#manager.email}",
"name": "#{#manager.name}",
"roleName": "Lessor",
"tabs": {
"texttabs": [{
"tabLabel": "Rent",
"value": "#{#lease.rent}"
},{
"tabLabel": "Address",
"value": "987 apple lane"
}]
}
}],
"status": "sent"
}.to_json
baseUrl that I am sending to:
"https://demo.docusign.net/restapi/v2/accounts/my_id/envelopes"
In your texttabs section, you should be passing in the following parameters at a minimum per tab: tablabel & value.
tablabel is the name of the tab that you have defined on the template. So from what I can tell, you have a text box on your template called Address. So you should put "tablabel":"Address".
value is what you would like to pre-populate in the tab. Looks like you have that correct.
You do not want to use tabID as that is not a valid parameter in this flow. The API documentation details what parameters you can use: https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Tabs/Text%20Tab.htm?Highlight=data%20tab
I also see an extraneous parameter of "Rent" under templateRoles section. That value will be ignored since it is not a valid parameter.
Turns out the problem was not with the code but with the setup within docusign. Make sure that you are setting up your tabs correctly and if you want to replicate a field multiple times make sure that they all share the same exact name.

How to post event to particular google calendar using feed URL

I am trying to post an event to a particular google calendar.
I am using the following URL to post the event:
https://www.google.com/calendar/feeds/CALENDAR-ID/private/full
Using this I get this error:
<HTML>
<HEAD>
<TITLE>Authorization required</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Authorization required</H1>
<H2>Error 401</H2>
</BODY>
I understand that I need to request authorization to post on the calendar but I would like to post the event in my own calendar.
My questions:
1 - Do I need to use OAuth to post an event in my own calendar ?
2 - If not, is there any special URL (like magic-cookie) to use with a read-write access ?
3 - I have a Google API Key but I don't know if I can use it in this case and how it should be used ?
I am trying to post the event from an iOS application using NSURLConnection. Here is the details:
{
"data": {
"title": "Tennis with Beth",
"details": "Meet for a quick lesson.",
"transparency": "opaque",
"status": "pending",
"location": "Rolling Lawn Courts",
"when": [
{
"start": "2013-08-07T15:00:00.000Z",
"end": "2013-08-07T17:00:00.000Z"
}
]
}
}
Headers:
Content-type: application/json
Thank you for your help, I know there is a lot of similar question over internet but everything I try doesn't work and I don't understand the OAuth things in documentation (as I never used OAuth). Also I can;t find in google documentation the case when you want your users to post in a particular calendar.
I found another post on StackOverflow which deals exactly with what I was looking for. The post explain the method using PHP but the process is still the same for iOS.
Google Calendar API v3 hardcoded credentials

How to POST JSON request in cross domain in sencha touch

I have got following URL
https://development.avalara.net/1.0/tax/get
and would like to POST following JSON request body
{
"DocDate": "2011-05-11",
"CustomerCode": "CUST1",
"Addresses":
[
{
"AddressCode": "1",
"Line1": "435 Ericksen Avenue Northeast",
"Line2": "#250",
"PostalCode": "98110"
}
]
}
which then will give JSON response
{
"DocCode": "78b28084-8d9a-477c-9f26-afab1c0c3877",
"DocDate": "2011-05-11",
"Timestamp": "2011-05-11 04:26:41",
"TotalAmount": 10,
"TotalDiscount": 0,
"TotalExemption": 0,
"TotalTaxable": 10,
"TotalTax": 0.86,
“TotalTaxCalculated”: 0.86,
"TaxDate": "2011-05-11",
.......
}
I have tried to use
Ext.Ajax.request
but get error
Origin http://localhost is not allowed by Access-Control-Allow-Origin.
which might be due to having different domain.
So, then i tried to use JSONP
Ext.data.JsonP.request
(
{
url: 'https://development.avalara.net/1.0/tax/get',
callbackName: 'test',
method: 'POST',
jsonData: '{"DocDate": "2011-05-11", "CustomerCode": "CUST1", "Addresses": [ { "AddressCode": "1", "Line1": "435 Ericksen Avenue Northeast","Line2": "#250", "PostalCode": "98110" } ] }' ,
success: function(response) {
//do some successful stuff
Ext.Msg.alert(response);
},
failure: function(response) {
//complain
Ext.Msg.alert('fail');
}
});
But URL 404(Not Found) error is encountered and request method is GET instead of POST.
Can anyone help me how POST request body(JSON) and obtaind JSON response from different domain?
Thanks in advance
You have four options:
Use CORS. development.avalara.net would need to setup CORS on the server and allow the domain that the Sencha page is running on.
Reverse Proxy requests through a server on the domain that the Sencha page is running on:
Sencha page (mydomain.com) ---> Web Server (mydomain.com) ---> development.avalara.net
Sencha page (mydomain.com) <--- Web Server (mydomain.com) <--- development.avalara.net
You could also POST the form as a regular form post action, or POST the form inside a hidden iframe.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.Basic-cfg-standardSubmit
Run the Sencha app inside phonegap/cordova which does not block cross-domain requests.
You cannot do JSON-P with POST requests, JSON-P only supports GET requests. Your options are:
Use a GET request with JSON-P
Move the server functionality to the same server your ST app is running
Use something like Cordova and Whitelist the server you want to use for your AJAX POST requests, then use Ext.Ajax.request.

Resources