Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » REST API Auth issue,(admin:admin is not working.)
REST API Auth issue, [message #1431925] Fri, 26 September 2014 10:39 Go to next message
Ramakrishna R is currently offline Ramakrishna RFriend
Messages: 14
Registered: September 2014
Junior Member
Team,

I was trying to hit the url http://127.0.0.1:8080/om2m/gscl as discussed in the REST API section via a rest client with admin/admin credentails. But its getting failed with the below error.

Sep 26, 2014 3:11:19 PM org.eclipse.om2m.core.router.Router doRequest
INFO: ResponseConfirm [statusCode=STATUS_NOT_FOUND, representation=<?xml version
="1.0" encoding="UTF-8" standalone="yes"?>
<om2m:errorInfo xmlns:om2m="http://uri.etsi.org/m2m" xmlns:xmime="http://www.w3.
org/2005/05/xmlmime">
<om2m:statusCode>STATUS_NOT_FOUND</om2m:statusCode>
<om2m:additionalInfo>Requesting Entity [admin:admin] does not exist in permi
ssions</om2m:additionalInfo>
</om2m:errorInfo>
, resourceURI=null]

Can somebody help me out on this please?

Thanks,
RK
Re: REST API Auth issue, [message #1431974 is a reply to message #1431925] Fri, 26 September 2014 12:20 Go to previous messageGo to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
Hello Ramakrishna,

You have to use the token admin/admin (instead of admin:admin)
Here is a curl example: curl -H "Authorization: Basic YWRtaW4vYWRtaW4" 127.0.0.1:8080/om2m/nscl
So, please tell me this works for you.

I will push an update to replace "/" with ":" to make it simple for every body.

Thanks






[Updated on: Fri, 26 September 2014 12:22]

Report message to a moderator

Re: REST API Auth issue, [message #1432160 is a reply to message #1431974] Fri, 26 September 2014 18:24 Go to previous message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
You can update the "org.eclipse.om2m.adminRequestingEntity" on the configuration file and set "admin:admin" instead of "admin/admin".
Every things will work correctly expect the webinterface because it encodes the basic authentication based on "/".
But this is very simple to fix. You need to replace "/" by ":" in the om2m.js code like this:

File: org.eclipse.om2m.webapp.resourcesbrowser/src/main/resources/webapps/om2m.js

function make_base_auth(user, password) {
var tok = user + ':' + password;
var hash = btoa(tok);
return "Basic " + hash;
}

Please tell me if it is ok for you.

Mahdi



[Updated on: Fri, 26 September 2014 18:25]

Report message to a moderator

Previous Topic:OM2M
Next Topic:503 error Service Unavailable
Goto Forum:
  


Current Time: Fri Apr 26 14:13:19 GMT 2024

Powered by FUDForum. Page generated in 0.03551 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top