Oracle Webcenter REST API Authentication
Hi All,
I am getting authentication error while consuming the Webcenter REST API url http://webcenter.us.oracle.com/rest/api/resourceIndex.In Jdeveloper (URL Datacontrol)
So please help me where to Provide the authentication details.
Thanks.
Hi.
You need to add Authentication to your REST requests. Using Oracle WebCenter Portal REST APIs - 11g Release 1 (11.1.1.6.3)
From my experience, I always used REST API from a REST Java Wrapper done by a mate: Oracle Webcenter Portal & Content Tips: Using WebCenter REST API from Java
- Samples snippet of authentication:
When executing code inside of the domain use OIT:
b64EncodedToken = WCSecurityUtility.issueTrustServiceSecurityToken();
String auth = "OIT " + b64EncodedToken;
connection.setRequestProperty(AUTH_PROPERTY, auth);
When executing code for testing in your JUnit or outside, use directly BASIC authentication:
String userpass = "weblogic:weblogic1";
BASE64Encoder encoder = new BASE64Encoder();
b64EncodedToken = encoder.encode(userpass.getBytes());
String auth = "Basic " + b64EncodedToken;
Create a DataControl manually create an instance of the connection depending of the environment.
Take a look in the official documentation and in the blog entry links.
Regards.
Similar Messages
-
Working on PS3 webcenter framework. The message items in the response for urn:oracle:webcenter:messageBoard have only read and delete capabilities. The update capabilities for messages from message board is missing. Is this a bug or a configuration issue?
Please refer below :
Using Oracle WebCenter REST APIs
Oracle Webcenter Portal & Content Tips: Using WebCenter REST API from Java
Thanks -
How to use WebCenter REST API to like or comment a activity
Hi all
I want to know how to realize like or comment function with REST APIs.
I execute a REST call with following url, but the 'like' counter is not be increased.
http://cdcjp77vm3.cn.oracle.com:8888/rest/api/activities/services/oracle.webcenter.community/objectTypes/groupSpace/objects/(s2518c69b_1989_4a63_8886_c32075c76b9c)/likes?&utoken=FDNA-Z7ekZuPnVSNoPWOqTJ2IzAE_w**
Is there anything i missed?
Can anyone give me an example about how to use this API to like or comment a activity?
Thanks
QianSo Qian;
looking through the code this is how you can
Post a comment (POST)
/rest/api/activities/services/{serviceId}/objectTypes/{objectType}/objects/({objectId})/comments?startIndex={startIndex}&itemsPerPage={itemsPerPage}&utoken=blah
{key:val}
{text:'this is my comment)
Edit a comment (PUT)
So I haven't tried it but it should do the trick.. although I don't see update under capabilities so you may get blocked.
/rest/api/activities/services/{serviceId}/objectTypes/{objectType}/objects/({objectId})/comments?startIndex={startIndex}&itemsPerPage={itemsPerPage}&utoken=blah
id: {commentId},
text: 'changed my comment.. magic'
Delete a comment (DELETE)
/rest/api/activities/services/{serviceId}/objectTypes/groupSpace/objects/({objectId})/comments/{commentId}?utoken=blah
Like POST
/rest/api/activities/services/{serviceId}/objectTypes/{objectType}/objects/({objectId})/likes?startIndex={startIndex}&itemsPerPage={itemsPerPage}&utoken=blah
I passed it an empty object {} seemed to work for me.
Unlike (DELETE)
/rest/api/activities/services/oracle.webcenter.community/objectTypes/groupSpace/objects/({objectId})/likes/({likeId})?utoken=blah
Let me know if this works for you -
Consume Webcenter REST API for Mobile App
Hi All,
I have some requirement like How to consume web center REST API to the ADF mobile
could you please guide to it any examples,links.
When i am trying to consume by using URL Data control it is showing authentication failed, can you pls tell me how to resolve this issue.
Is there any procedure do the same.
Thanks in Advance .
Message was edited by: 878913Well was able to resolve it however had to do workaround
>> used rawXhrPost and put methods instead of xhrPost/put as the dojo.xhrPost seems to insist on sending the data as key=value
pairs separated by a '&' which on one hand lead webcenter to believe there
wasn't any POST data as it was expecting json ..
however if anyone has used xhrPost with webcenter rest , please guide how to use it ... casue and unable to use it .
also which is the right way to do it ? xhrpost or rawXhrPost , asthe later this method is not extensively mentioned... seems its going to be depricated... -
Oracle Beehive REST API - Instant Message
Hi all,
We need to implement a chat client using Beehive's REST API. Somehow, we encounter a problem when calling comb/v1/d/imsg/{name} service. We have tried to enter many possible value for {name} like userID, collabID, random string, but all of them result in a same error: "invalidUriFailure","httpStatusCode":404,"cause":"The URI
passed to the server does not correspond to a valid Resource". Could somebody help on pointing the correct value for {name}? Any clue will be very much appreciated :)
- Darwin -Self replying to my question for the records
All the doc is there, including tutorial and sample code
http://www.oracle.com/technetwork/middleware/beehive/platform-098968.html -
can anyone tell me how to consume webcenter discussion forums REST API ? I need to customize the discussio nforum taskflow for my project.
you can follow the below mentioned links-
http://download.oracle.com/docs/cd/E15523_01/webcenter.1111/e10148/jpsdg_jive.htm#CHDGJECD
http://www.art2dec.com/documentation/docs/fmw11g1114documentation/webcenter.1111/e10148/jpsdg_rest_api.htm#BGBDGDAC
http://pmoskovi.wordpress.com/2010/01/05/webcenter-rest-api-sample/ -
Error Using REST API to Retrieve SharePoint content
I am developing a rather simple application that retrieves files from SharePoint using the REST Office 365 API. This is a batch job running in the background with no user interface so the following simple 2-step flow is what I'm doing:
(1) Requesting an Access Token from Azure AD (supplying client ID, client secret, resource, and grant_type=client_credentials)
(2) Invoke the SharePoint API (https://{base url}/_api/v1.0/Files) using the "Authorization: Bearer <access_token>" as a request header .
That process seems pretty straightforward and sounds simple but I keep getting the following error :
401 Unauthorized
x-ms-diagnostics: 3001000;reason="There has been an error authenticating the request.";category="invalid_client"
Any idea what the problem is and how this can be resolved ? I have been stuck on this for days now. I would REALLY appreciate somebody's help with this. Thanks.
- CWHi,
According to the error message, the issue is related to Office 365 Rest API authentication.
I suggest you can check the detailed web request using Fiddler to check the access token is valid in the request.
Here are detailed articles for your reference:
Files REST operations
Remote authentication in SharePoint Online
Fiddler
Thanks
Best Regards
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Jerry Guo
TechNet Community Support -
Spring version with rest api of webcenter sites
Hi everyone!
I'm using the rest api of webcenter sites, with this libraries: com.fatwire.wem.api.rest 11.1.1.8.0, com.fatwire.wem-sso-api-cas-11.1.1.8.0, com.fatwire.wem-sso-api-11.1.1.8.0 in a spring application with version 3.2.10.RELEASE. And it's works fine! I'm getting a list of assets and all their attributes, but I need use this application with the spring version 4.0.6.RELEASE, then when I update the spring version the rest api this libraries do not work. This is the method that fails:
SSOSession ssoSession = SSO.getSSOSession(baseUri);
multiticket = ssoSession.getMultiTicket(username, password); -> ERROR LINE
baseResource = baseResource.queryParam("multiticket", multiticket);
this because the application cannot get a mutiticket. I'm using the same code and the same structure only changes the spring version. Oracle webcenter is updated with all the patches until this date.
How it's possible solve this?
ThxSOLVED
private void authenticate() throws RestConnectionException {
try {
SSOSession ssoSession = SSO.getSSOSession("CASConfig.xml");
multiticket = ssoSession.getMultiTicket(username, password);
baseResource = baseResource.queryParam("multiticket", multiticket);
} catch (SSOException e) {
throw new RestConnectionException(e);
CASConfig.xml
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<beans:bean id="ssoconfig" class="com.fatwire.wem.sso.cas.conf.CASConfig">
<beans:property name="casUrl" value="http://server:port/cas" />
<beans:property name="casInternalURL" value="http://server:port/cas"/>
</beans:bean>
<beans:bean id="ssoprovider" class="com.fatwire.wem.sso.cas.CASProvider">
<beans:property name="config" ref="ssoconfig" />
</beans:bean>
<!-- Used for ticket validation. In case of cluster with cas server behind
firewall, it must point to the cas server. -->
</beans:beans>
add the casconfig to the classpath in spring, set the server and port in xml and it works! -
How to watch forum using Webcenter Discussions REST API
If I am building an application using WebCenter Discussions REST API, what API should I invoke to watch forum, topic? If it is not available in the REST API, what is the workaround to do the same ?
Did not find relevant information in the [http://docs.oracle.com/cd/E23943_01/webcenter.1111/e10148/jpsdg_jive.htm#CHDGJECD] .Hi.
REST Discussions API allow you to get all information that you need. It provides URL to Forums, topics... Or directly you can access to the messages.
In addition, you can use REST Search API to search into discussion forums if you have Oracle SES.
Off doc about information that can you get through REST API: http://docs.oracle.com/cd/E23943_01/webcenter.1111/e10148/jpsdg_jive.htm#CHDGJECD
In the case of that you need more information about provided by REST API or WebCenter API then you can implement your own ADF BC to consume Discussions schema :).
Regards.
Edited by: Daniel Merchán on 16-oct-2012 15:16 -
Authentication for Stream Analytics REST Api
Hi there,
I am trying to use the stream analytics rest api from a java client. For other services (storage services for example), I am able to successfully use mutual certificate authorization. I create a management certificate using keytool and upload it through
the settings tab in azure portal. I then create an SSLContext from this certificate. This all works and I am able to get access to the storage services api.
The same flow does not seem to work for stream analytics api. When attempting to make an api call, I get 401 error code with the following response authorization header.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/streamingjobs?api-version=2014-10-01-preview
WWW-Authenticate=[Bearer authorization_uri="https://login.windows.net/{...}", error="invalid_token", error_description="The access token is missing or invalid."]
The result is the same whether or not I configure the certificate on the client side. So, it seems like the mutual certificate authorization is not supported in stream analytics as it is in the other management APIs. Can you confirm if this feature is not
supported? If it is not supported, can you please provide some information on how we should be authenticating for stream analytics REST api?
ThanksI did some more investigating. The Azure Stream Analytics REST Api documentation uses
https://management.azure.com/
as the base uri for managing stream analytics service. The .NET azure sdk source code on github, however, uses
https://management.core.windows.net/
for the same. So, I have tried accessing some different variations of resources.
https://management.core.windows.net/{my subscription id}/services/storageservices
Response: 200 OK
Here, I am using mutual certificate authorization to successfully reach storage services at management.core.windows.net. This verifies that the certificate authorization flow works for other services in the same subscription.
https://management.azure.com/subscriptions/{my subscription id}/resourcegroups/StreamAnalytics-Default-Central-US/providers/Microsoft.StreamAnalytics/streamingjobs?api-version=2014-10-01-preview
Response: 401 Unauthorized
Message: {"error":{"code":"AuthenticationFailed","message":"Authentication failed. The 'Authorization' header is not present or provided in an invalid format."}}
Now I attempt to use the same mutual certificate authorization on the management.azure.com base uri for stream analytics management. The request fails and the error message notes that an expected Authorization header is missing. This leads me to
believe that mutual certificate authorization is not supported on management.azure.com.
The Authorization header makes sense for OAuth2 flow, so I am thinking that management.azure.com
might only support OAuth2. I need server to server management, so OAuth2 flow will not work because it requires interactive browser redirect to work with management api. Active
Directory only gives delegate permissions to management services, not application permissions. I believe this rules out using OAuth2 / Active Directory for headless
authorization - please correct me if I am wrong.
https://management.core.windows.net/subscriptions/{my subscription id}/resourcegroups/StreamAnalytics-Default-Central-US/providers/Microsoft.StreamAnalytics/streamingjobs?api-version=2014-10-01-preview
Response: 403 Forbidden
Message: <Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Code>ForbiddenError</Code><Message>The server failed to authenticate
the request. Verify that the certificate is valid and is associated with this subscription.</Message></Error>
Here I try to use the mangagement.core.windows.net base uri that is used in .net sdk. I get a 403 forbidden response. The error message indicates that the server attempted to complete the mutual certificate authorization. The server complains, though,
that the certificate is invalid. This is the same certificate used successfully to manage storage services, so I know the certificate is valid and the client flow works.
It would be great if someone could expand on the discrepancy between the base uri in the documentation vs .net sdk and provide some guidance on server to server authorization to stream analytics management api.
Thanks,
Dave -
Enabling Authentication on REST API
How is authentication (basic, certificate) enabled on an APIMGMT REST API?
In the portal there is client sample code for various languages including C# that includes code to add authentication headers. However, this code is commented out.
Basic Authorization Sample
client.DefaultRequestHeaders.Authorization
=
new AuthenticationHeaderValue("basic", Convert.ToBase64String(Encoding.UTF8.GetBytes("{username}:{password}")));
How is basic authentication enabled so that this code can be uncommented?
Frankhi Frank,
Base on my experience, you need enable the basic authentication in this page:
Then you can uncomment this code and input the username and pwasword. Please try it.
Any concerns, please let me know.
Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Accessing sharepoint REST api using S2S authentication
Hi, I'm trying to access the SharePoint REST APIs (One-Drive for business) using the access token retrieved from S2S authentication flow (https://msdn.microsoft.com/en-us/library/azure/dn645543.aspx).
Currently, I'm getting the following exception:
he server was unable to process the request due to an internal error. For more information about
the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the
Microsoft .NET Framework SDK documentation and inspect the server trace log
Is this scenario (app auth instead of delegate auth) support for those set of APIs?
ThanksHi,
According to your description, my understanding is that you want to access SharePoint Online One-Drive for business API using OAuth 2.0 authentication.
In summary, Rest API can work with OAuth 2.0 authentication.
Here are some detailed articles about access Rest API with OAuth 2.0 authentication:
OAuth 2.0 Compliant REST API
Securing RESTful Web Services with OAuth2
About accessing One-Drive for business with Rest API, you can refer the article below:
Access OneDrive for Business using the SharePoint 2013 APIs
About the error message, I suggest you can use Fiddler to track the web request to find detailed message:
Fiddler
Thanks
Best Regards,
Jerry Guo
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
REST API - is authentication mandatory?
Regarding Sites REST API - is authentication mandatory? There are just a few items to get, and we're only giving a user permission to those. We see no reason to go through the trouble with the ticketing mechanism, not to mention the roundtrips.
Can authentication be disabled when using REST?This can be done via the Bulk API 1.0 Eloqua Bulk API 1.0: Importing and Exporting Data.
-
Unauthorized Issue in invoking REST API
Hi,
I am getting the following issue when i am calling the "GET" method of REST API:" https://secure.p03.eloqua.com/API/bulk/2.0/syncs/14"
Unauthorized
java.lang.RuntimeException: Failed : HTTP error code : 401
at GetContactSync.main(GetContactSync.java:41)
This is the code i have used to invoke the API:
String proxyhost="www-proxy.us.oracle.com";
int proxyport=80;
String inputparam="14";
String urlstring="https://secure.p03.eloqua.com/API/bulk/2.0/syncs/14";
String authString = "IBUDEMO\\aman.adarsh" + ":" + "Welcome@1";
//String authString = "IBUDEMO1\\aman.adarsh" + ":" + "Welcome@1";
String authToken = "Basic" + javax.xml.bind.DatatypeConverter.printBase64Binary(authString.getBytes());
String output="";
String line="";
URL url = new URL(urlstring);
//Properties systemProperties = System.getProperties();
//systemProperties.setProperty("http.proxyHost",proxyhost);
HttpURLConnection conn = (HttpURLConnection) url.openConnection(new Proxy(Type.HTTP,new InetSocketAddress(proxyhost, proxyport)));
conn.setInstanceFollowRedirects(false);
conn.setDoOutput(true);
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
//conn.setRequestProperty("Authorization", authToken);
conn.setRequestProperty("Proxy-Authorization", "Basic " + authToken);
System.out.println(conn.getResponseMessage());
if (conn.getResponseCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : " +
conn.getResponseCode());
I want to know if i have missed any parameter
The same authentication piece of code is working fine for "POST" methods of other API's
Request your help on thisHi,
I am getting the following issue when i am calling the "GET" method of REST API:" https://secure.p03.eloqua.com/API/bulk/2.0/syncs/14"
Unauthorized
java.lang.RuntimeException: Failed : HTTP error code : 401
at GetContactSync.main(GetContactSync.java:41)
This is the code i have used to invoke the API:
String proxyhost="www-proxy.us.oracle.com";
int proxyport=80;
String inputparam="14";
String urlstring="https://secure.p03.eloqua.com/API/bulk/2.0/syncs/14";
String authString = "IBUDEMO\\aman.adarsh" + ":" + "Welcome@1";
//String authString = "IBUDEMO1\\aman.adarsh" + ":" + "Welcome@1";
String authToken = "Basic" + javax.xml.bind.DatatypeConverter.printBase64Binary(authString.getBytes());
String output="";
String line="";
URL url = new URL(urlstring);
//Properties systemProperties = System.getProperties();
//systemProperties.setProperty("http.proxyHost",proxyhost);
HttpURLConnection conn = (HttpURLConnection) url.openConnection(new Proxy(Type.HTTP,new InetSocketAddress(proxyhost, proxyport)));
conn.setInstanceFollowRedirects(false);
conn.setDoOutput(true);
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
//conn.setRequestProperty("Authorization", authToken);
conn.setRequestProperty("Proxy-Authorization", "Basic " + authToken);
System.out.println(conn.getResponseMessage());
if (conn.getResponseCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : " +
conn.getResponseCode());
I want to know if i have missed any parameter
The same authentication piece of code is working fine for "POST" methods of other API's
Request your help on this -
Hello:
Is there documentation for DocLib APIs available, internally or externally? or JavaDoc?
Thanks,While what has been said is correct (the DocLib Taskflow ) has no public api's , there are api's that can be used for working with content that are provided with WebCenter Framework.
(1) DataControls
See: [http://download.oracle.com/docs/cd/E15523_01/webcenter.1111/e10148/jpsdg_content.htm#DAFBIBFF|http://download.oracle.com/docs/cd/E15523_01/webcenter.1111/e10148/jpsdg_content.htm#DAFBIBFF]
(2) Content Management REST based API's
See: http://download.oracle.com/docs/cd/E15523_01/webcenter.1111/e10148/jpsdg_rest_api.htm#CDEBFIII
and more specifically see: http://download.oracle.com/docs/cd/E15523_01/doc.1111/e15813/toc.htm
Please note that the CM REST api's only support UCM.
Edited by: Marcus Diaz on Jan 20, 2010 9:47 AM
Maybe you are looking for
-
How to deal with resource bundle in multiple applications system
Hi all, I'm building new system depend on the method of one common model with multiple applications for the view objects my JDeveloper version 11.1.2.3 my Question How can i merge the resource bundle for these applications as in the common model exis
-
Sending HTML E Mail using Java Mail
Can anybody please tell me how to send HTML email using JavaMail. I know I need the DataContentHandler for text/html mime type but where can I find one? If anybody has better suggestions you are welcome.
-
I cannot find the SCXI chassis containing two SCXI-1102 boards using the MAX software. I have added the SCXI 1000 using the new command, and manually configured the cards, but the MAX software refuses to admit that they exist. The 6052E passes its te
-
Can you please post about 50 entires in Input VAT account and 50 in Output VAT Account through FI JV and then transfer these line items to VAT Vendor A/c u2013 if needed create one Vendor Can any one tell me what exactly this line means
-
Error msg: System Preferences not available on this Mac?
I want to change my screensaver -- I last did it in the Fall of 2010. Now I get this error message? When I use Finder to search for System Preferences, the icon is faint with a strike through it. How can I CHANGE system preferences? Did this happ