1

Has anyone used the database credential store com.ibm.sbt.security.credential.store.DBCredentialStore to store tokens for an OAuth2 endpoint. I am running a simple app on WebSphere 7 with a db2 database for the token storage. I have the managed bean for the store correctly configured in managed-beans.xml

<managed-bean>
    <managed-bean-name>CredStoreDB</managed-bean-name>
    <managed-bean-class>com.ibm.sbt.security.credential.store.DBCredentialStore</managed-bean-class>
    <managed-property> 
        <property-name>jndiName</property-name> 
        <value>jdbc/sbtk</value> 
    </managed-property>
    <managed-property> 
        <property-name>tableName</property-name> 
        <value>SBTKREP</value> 
    </managed-property>
    <managed-bean-scope>application</managed-bean-scope>
    <!-- Fixed OAuth Application parameters -->
</managed-bean>

but the credentials never get stored to the database... no errors either. I can see in code that my endpoint is using the correct credentials store by doing...

pw.println("credential store is " + ((OAuth2Endpoint) ep).getCredentialStore());

What actually causes the credentials to be stored.. has anyone done this before? Any help appreciated. Thanks.

Machavity
  • 30,841
  • 27
  • 92
  • 100
  • also, does your user, at the time of the request have a J2EE Principal? I believe it is stored in the database based on that key – Paul Bastide Mar 31 '14 at 12:12

1 Answers1

2

Make sure that the SBTKREP table exists in the database at jdbc/sbtk

If not, there are some scripts to run here: https://github.com/OpenNTF/SocialSDK/tree/master/samples/dbscripts

Lorenzo Boccaccia
  • 6,041
  • 2
  • 19
  • 29