Forum Stats

  • 3,875,518 Users
  • 2,266,939 Discussions
  • 7,912,241 Comments

Discussions

Spring data or Hibernate Oracle proxy authentication.

mlov83
mlov83 Member Posts: 339 Bronze Badge
edited Mar 10, 2018 5:33PM in Java Programming

I'm embarrassed to say that I have not been able to get oracle proxy authentication to work, I feel like I'm simply missing something.  I'm working on an application where I need to user oracle proxy authentication, and I can't seem to be able to set up my datasource correctly. I'm currently using spring boot and Oracle ojdbc 7 with ucp. I'm not asking for anyone to do my job here, I'm simply desperate to see a full working example. Does anyone here , have a working example of oracle proxy auth, with spring or hibernate? Or perhaps suggest any ORM llibary that would work nicely with oracle proxy auth. Thanks in advance all.

Answers

  • Unknown
    edited Mar 10, 2018 11:57AM
    I'm embarrassed to say that I have not been able to get oracle proxy authentication to work, I feel like I'm simply missing something.

    The 'something' missing is that you haven't posted ANYTHING that SHOWS US:

    1. WHAT you do

    2. HOW you do it

    3. WHAT results you get

    . . . and I can't seem to be able to set up my datasource correctly

    We can't help you find errors in your code when you don't post the code!

    I'm simply desperate to see a full working example.

    The JDBC Developer Guide has an entire chapter on Proxy Authentication

    https://docs.oracle.com/database/121/JJDBC/E49300-05.pdf

    That chapter also discusses the various types of proxy connections that can be used and how to use them. Though, again, since you haven't posted anything we have NO IDEA:

    1. what type of proxy connection you are trying to use

    2. what your full versions of Java, JDBC driver, spring, hibernate

    3. what configuration you have done with spring, hibernate

    Or perhaps suggest any ORM llibary that would work nicely with oracle proxy auth.

    Proxy authentication simply uses a different format of connection parameters. Oracle does NOT know, and does not care, if the client is using java only, or is also using spring or hibernate

    Yours is most likely a configuration issue for spring or hibernate (but no info posted) so you need read those docs and then post in one of those forums for configuration help and examples of how to configure them.

    Test your proxy connection code using ONLY Java with no spring or hibernate involved. The Oracle doc above has examples of how to do that. But if you still need help with that you will have to post the Java test code you are using and SHOW US the execution and results.

    Once that works you will know for sure the problem is that you haven't configured spring or hibernate to use the connection parameters that your standalone Java test uses.

  • mlov83
    mlov83 Member Posts: 339 Bronze Badge
    edited Mar 10, 2018 4:57PM

    Thanks for the reply RP0428,  I will admit I did a poor job in my initial question and for that I apologize.  What I should have said was, I have figured out how to use jdbc with oracle proxy authentication without any issues. My real problem, is that i'm trying to implement oracle proxy authentication with spring data. This has become quite difficult since all the examples I have seen require you to have the datasource with username and password already set up when the application starts. So, in my case I know I can do that with the proxy user, but I have no idea how to essentially change the connection after the initial datasource the connection to use the new users username and proxy. This is where I'm stuck and I was hoping to see if someone here has already done it. Sorry my initial question was bit vague.

  • Unknown
    edited Mar 10, 2018 5:22PM
    but I have no idea how to essentially change the connection after the initial datasource the connection to use the new users username and proxy.

    You need to follow the steps in the doc (page 10-4) that tell you how to create a proxy session using the initial

    connection.openProxySession(

    Whatever code you are using to establish the proxy needs to call that method.

    In your case that will be spring or hibernate. So it is a question for one of those forums on how to configure those.

    Go ahead and wait a few days to see if anyone chimes in but it is really a question for spring or hibernate, not Oracle.

  • mlov83
    mlov83 Member Posts: 339 Bronze Badge
    edited Mar 10, 2018 5:33PM

    Thanks RP I will wait a bit and see if anyone else has figured this out. Been going at it for a while and was hoping to see if anyone here has a solution.

This discussion has been closed.