Creating an Oracle REST Data Services User with the ‘SQL Developer’ Role

thatjeffsmith ORDS 12 Comments

Tell Others About This Story:

Want to publish some RESTful services using SQL Developer and Oracle REST Data Services (ORDS)?

You’re in luck!

View > REST Data Services > Development.

Before you can do this, a few things.

  • you’ll need to install and run ORDS
  • you’ll need to REST enable a schema
  • you’ll need to have created an ORDS user with the ‘SQL Developer’ role

When installing ORDS, you’re prompted to create two users, and ADMIN user for configuring ORDS, and a development user for publishing RESTful Service modules.

These are the users you'll be logging in with to admin ORDS and configure RESTful services.

These are the users you’ll be logging in with to admin ORDS and configure RESTful services.

You may have skipped this step. Oops.

Or maybe you need to create a new user.

If you try to login using an invalid user/connect, then you’ll get this:

Doh!

Doh!

So how are we connecting? If we look at the connection properties, we see this:

Details, details,...

Details, details,…

So I’m asking to connect over HTTP (if you picked secure/https – this won’t work), to server ‘localhost’ on port ‘8080’ using user ‘ords_dev’, and we’re doing ORDS RESTFul services (vs APEX) – so that’s ‘/ords’, and then our schema is ‘/peeps/’ – which is what I aliased HR to when I REST enabled it.

When ORDS gets a request and it sees ‘/ords’ – it switches to REST enabled schemas and schema objects and modules. Otherwise, it sees your request as an APEX thing. The bit that comes AFTER ‘/ords’ will be the schema name or schema alias.

So…either my user is setup wrong, or I forgot to set it up.

Jump to the box where ORDS is running. Find your .war file. If you do a ‘ps -ef | grep ords.war’ you should see where ORDS is running out of. Then you can create the user like so:

You're prompted for the password and you'll have to repeat it.

You’re prompted for the password and you’ll have to repeat it.

By the way, this is covered in the Docs, the Admin and Dev Guide to be specific.

Now we’re cooking with gas. Now I can connect and pull down and push up modules for my RESTful Services.

I really like this part, if you know SQL or PL/SQL, you can create a RESTful Service.

I really like this part, if you know SQL or PL/SQL, you can create a RESTful Service.

What if you’re not running ORDS in standalone mode?

If you’re running it in Glassfish or WebLogic, then you’ll still create a user – a Glassfish user – and give it the ‘SQL Developer’ role. So same difference basically.

Tell Others About This Story:

Comments 12

  1. Were you able to fix the issue of connecting to ords services in weblogic thro’ SQL developer? I am facing the same issue. I am getting HTTP/1.1 401 Unauthorized. Thanks

  2. Hi Jeff,
    I need to do the same thing GlassFish, can you help, and if it is a must to create the same user in ORDS as in the standalone setup?

    Omar

    1. thatjeffsmith Post
      Author
  3. Hello,
    I have a question. I want to run ords in (integrated) weblogic.
    How do I give a user the SQL Developer role in weblogic?
    Does this role exist?

    Thank you

    1. thatjeffsmith Post
      Author
        1. I am facing the same problem and can’t find a solution.
          I have created the user in ORDS (using: java -jar ords.war user test_developer “SQL Developer”) and then created a user with the same name in weblogic, created a group with the name “SQL Developer” and assigned it to the test_developer user, but I am still getting the “Cannot connect to weblogic.
          HTTP/1.1 401 Unauthorized”
          Help! 🙂

          1. thatjeffsmith Post
            Author
        2. Exactly I faced the same issue and i resolved it. Go to Edit existing RESTful Services Connection > correct the last parameter – Schema/Workspace. It should work.

Leave a Reply

Your email address will not be published. Required fields are marked *