9 Replies Latest reply on Oct 15, 2014 9:31 AM by tejones

    OData Error

    jjaideep2000

      I have VDB deployed and I can execute sql query on it. But when I try to run the query using OData, I get error. Can someone please help?

       

      http://localhost:8080/odata/TestODataVDB/$metadata

       

      JBWEB000065: HTTP Status 403 - JBWEB000015: Access to the requested resource
      has been denied

       


       

       

      JBWEB000309: type JBWEB000067: Status report

       

      JBWEB000068: message JBWEB000015: Access to the requested resource
      has been denied

       

      JBWEB000069: description JBWEB000123: Access to the specified
      resource has been forbidden.

        • 1. Re: OData Error
          tejones

          Hi Jaideep,

           

          Make sure your user has the "odata" role.

           

          OData Support - Teiid 8.9 (draft) - Project Documentation Editor

           

          Thanks,

          Ted

          • 2. Re: OData Error
            jjaideep2000

            Hi Ted.

            Configuration in the web.xml looks correct, but still getting the same error

             

            Also, I am wondering, which user id and password, it is expecting? is it Teiid user id/password, I have the default one user=user. Or is it expecting the database userid/password?

             

            If I try using user/user for login. I see this on the console:

            11:05:49,647 WARN  [org.teiid.SECURITY] (New I/O worker #7) null TEIID40011 Processing exception 'TEIID40042 Invalid Session 2f+E9FaYnbKa. Session may have already been terminated.' for session null.

            org.teiid.client.security.InvalidSessionException thrown from org.teiid.services.SessionServiceImpl.getSessionInfo(SessionServiceImpl.java:365). Enable more detailed logging to see the entire stacktrace.

             

             

            Web.xml:

            <security-role>

             

            <description>security role</description>

             

            <role-name>odata</role-name>

             

            </security-role>

             

            <security-constraint>

             

            <display-name>require valid user</display-name>

             

            <web-resource-collection>

             

            <web-resource-name>Teiid Rest Application</web-resource-name>

             

            <url-pattern>/*</url-pattern>

             

            </web-resource-collection>

             

            <auth-constraint>

             

            <role-name>odata</role-name>

             

            </auth-constraint>

             

            </security-constraint>

             

            <login-config>

             

            <auth-method>BASIC</auth-method>

             

            <realm-name>localhost</realm-name>

             

            </login-config>

            • 3. Re: OData Error
              tejones

              Hi Jaideep,

               

              You need to add the "odata" role for "user" in {as7InstallLocation}/standalone/configuration/teiid-security-users.properties. By default, the user will be authenticated against Teiid's default security domain "teiid-security" and makes use of the security role odata.

               

              Thanks,

              Ted

              • 4. Re: OData Error
                jjaideep2000


                Hi Ted,

                I don't see teiid-security-users.properties and teiid-security-roles.properties files in standalone/configuration. I see application-roles.properties and application-users.properties files only. Do I have to create teiid-security-***.properties files manually?

                 

                Thanks,

                • 5. Re: OData Error
                  tejones

                  No Jaideep.. you don't need to create the property files. In older versions of Teiid, the property files were located in the Teiid module (org/jboss/teiid/main/conf). What version are you using?

                   

                  Thanks,

                  Ted

                  • 6. Re: OData Error
                    jjaideep2000


                    Ted,

                    I am using 8.8.1. These files are not in the distribution archive.

                     

                    teiidZip.png

                    • 7. Re: OData Error
                      tejones

                      Ah.. it looks like those files have been removed. You can update "user" in the application-roles.properties file to add the "odata" role.

                      • 8. Re: OData Error
                        jjaideep2000

                        Ted,

                        I added application user using bin\add-user.bat and it did the trick. Now I am able to see the data using OData API.

                        Thanks very much for all your help.

                         

                        Best,

                        Jaideep

                        • 9. Re: OData Error
                          tejones

                          That's great Jaideep. Glad we could get you up and running with OData.