udit.rajput2010 Posted February 15, 2017 Share Posted February 15, 2017 I am using external database authentication with oracle 12c. How can write "SELECT u.username,u.password,u.enabled FROM jiuser u WHERE u.username = ?" Query In Oracle database.I have try SELECT USER_NICK_NAME username, PASSWORD, 'true' enabled FROM XXCP_USER_LOGIN WHERE USER_NICK_NAME = 'akhilesh.kumar'Tools:Configuration File Name applicationContext-externalAuth-db.xml<bean id="externalUserDetailsService" class="com.jaspersoft.jasperserver.api.security.externalAuth.db.ExternalJDBCUserDetailsService"> <property name="dataSource" ref="externalDataSource"/> <property name="usersByUsernameQuery" value="SELECT USER_NICK_NAME username, PASSWORD, 'true' enabled FROM XXCP_USER_LOGIN WHERE USER_NICK_NAME = ?"/> <property name="authoritiesByUsernameQuery" value="SELECT u.USER_NICK_NAME username, r.ROLE_NAME rolename FROM XXCP_USER_LOGIN u, XXCP_ROLE r WHERE u.ROLE_ID = r.ROLE_ID and u.USER_NICK_NAME = ?"/> </bean> Java 8Oracle 12cjasper Server 6.3.0 community Edition.Tomcat 8Stack trace:ERROR EncryptionAuthenticationProcessingFilter,http-nio-8080-exec-9:218 - An internal error occurred while trying to authenticate the user.org.springframework.security.authentication.InternalAuthenticationServiceException: PreparedStatementCallback; uncategorized SQLException for SQL [sELECT USER_NICK_NAME username, PASSWORD, 'T' enabled FROM XXCP_USER_LOGIN WHERE USER_NICK_NAME = ?]; SQL state [99999]; error code [17059]; Fail to convert to internal representation; nested exception is java.sql.SQLException: Fail to convert to internal representationHow can i use boolean datatype in ORACLE.Please Help me. Link to comment Share on other sites More sharing options...
udit.rajput2010 Posted February 16, 2017 Author Share Posted February 16, 2017 I have sort out my problem."SELECT USER_NICK_NAME username, PASSWORD, 1 enabled FROM XXCP_USER_LOGIN WHERE USER_NICK_NAME = ?" Link to comment Share on other sites More sharing options...
salemfahad Posted May 27, 2019 Share Posted May 27, 2019 Hi Udit, Can you tell me how you created the external authentication? I am looking for a way to implement custom authentication but I can't understand the tutorials. Please help if you can. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now