Fórumok

Valamis ELearning: DB and OAuth questions

Niccolò Pasquetto, módosítva 9 év-val korábban

Valamis ELearning: DB and OAuth questions

New Member Bejegyzések: 13 Csatlakozás dátuma: 2013.04.11. Legújabb bejegyzések
Hello everyone!
I installed Valamis 2.0 (http://www.valamislearning.com/index) on Liferay 6.2 and I find it a very interesting tool for e-learning.

But I need some clarification on some technical problems I encountered during testing:
  • Using Oracle does not create a table called Leran_LFCertificateTincanStatement because of the name too long. Since Liferay service-builder is benn used, it's possible to regenerate the classes using a shorter name for the tables?
  • Which version of OAuth should I use? If it's OAuth 2 grant_type which we have to use?

Thanks for your help,
Niccolò
thumbnail
Tanweer Ahmed ., módosítva 1 év-val korábban

RE: Valamis ELearning: DB and OAuth questions

Expert Bejegyzések: 322 Csatlakozás dátuma: 2010.03.11. Legújabb bejegyzések
Hi Niccolo,

Using Oracle does not create a table called Leran_LFCertificateTincanStatement because of the name too long. Since Liferay service-builder is benn used, it's possible to regenerate the classes using a shorter name for the tables?


You can have different names for the Entity and Database table.You can try something like this
<entity name="Leran_LFCertificateTincanStatement" table="ANY_SMALLER_NAME"></entity>

table is the name of the Database table which will be created and will be mapped to Object Leran_LFCertificateTincanStatement as the ORM.

Regards,
Tanweer.
thumbnail
Janne Hietala, módosítva 9 év-val korábban

RE: Valamis ELearning: DB and OAuth questions

Junior Member Bejegyzések: 97 Csatlakozás dátuma: 2009.06.16. Legújabb bejegyzések
Hi Niccolò,

Thank you for spotting this. This is actually recurring issue with Oracle db's and 30 character limit with table names.

We plan to release fix for Valamis EE 2.2.

OAuth version in Valamis is 1.0.

Best regards,
Janne Hietala
Niccolò Pasquetto, módosítva 9 év-val korábban

RE: Valamis ELearning: DB and OAuth questions

New Member Bejegyzések: 13 Csatlakozás dátuma: 2013.04.11. Legújabb bejegyzések
Thanks for your reply!
Janne Hietala:
We plan to release fix for Valamis EE 2.2.

There will be a commit on the GitHub repository for the fix?

Janne Hietala:
OAuth version in Valamis is 1.0.

Thanks for your reply, but there is something strange: I've noticed just now that I recive this errors from the Valamis server:

OAuthProblemException{error='invalid_request', description='Missing response_type parameter value', uri='null', state='null', scope='null', redirectUri='null', responseStatus=0, parameters={}}
	org.apache.oltu.oauth2.common.exception.OAuthProblemException.error(OAuthProblemException.java:59)
	org.apache.oltu.oauth2.common.utils.OAuthUtils.handleOAuthProblemException(OAuthUtils.java:167)
	org.apache.oltu.oauth2.as.request.OAuthAuthzRequest.initValidator(OAuthAuthzRequest.java:53)
	org.apache.oltu.oauth2.as.request.OAuthRequest.validate(OAuthRequest.java:60)
	org.apache.oltu.oauth2.as.request.OAuthRequest.&lt;init&gt;(OAuthRequest.java:52)
	org.apache.oltu.oauth2.as.request.OAuthAuthzRequest.&lt;init&gt;(OAuthAuthzRequest.java:43)
	com.arcusys.learn.controllers.oauth.InitializeApiController$$anonfun$1.apply(InitializeApiController.scala:22)
	org.scalatra.ScalatraBase$class.org$scalatra$ScalatraBase$$liftAction(ScalatraBase.scala:250)
	org.scalatra.ScalatraBase$$anonfun$invoke$1.apply(ScalatraBase.scala:245)
	org.scalatra.ScalatraBase$$anonfun$invoke$1.apply(ScalatraBase.scala:245)
	org.scalatra.ScalatraBase$class.withRouteMultiParams(ScalatraBase.scala:321)
	org.scalatra.ScalatraServlet.withRouteMultiParams(ScalatraServlet.scala:49)
	org.scalatra.ScalatraBase$class.invoke(ScalatraBase.scala:244)


As you can see, the exceptions are from org.apache.oltu.oauth2 package...it seems a OAuth 2.0 implementation....correct?
Alexander Klimov, módosítva 9 év-val korábban

RE: Valamis ELearning: DB and OAuth questions

New Member Bejegyzés: 1 Csatlakozás dátuma: 2014.12.10. Legújabb bejegyzések
Niccolò Pasquetto:
Thanks for your reply, but there is something strange: I've noticed just now that I recive this errors from the Valamis server:

OAuthProblemException{error='invalid_request', description='Missing response_type parameter value', uri='null', state='null', scope='null', redirectUri='null', responseStatus=0, parameters={}}
	org.apache.oltu.oauth2.common.exception.OAuthProblemException.error(OAuthProblemException.java:59)
	org.apache.oltu.oauth2.common.utils.OAuthUtils.handleOAuthProblemException(OAuthUtils.java:167)
	org.apache.oltu.oauth2.as.request.OAuthAuthzRequest.initValidator(OAuthAuthzRequest.java:53)
	org.apache.oltu.oauth2.as.request.OAuthRequest.validate(OAuthRequest.java:60)
	org.apache.oltu.oauth2.as.request.OAuthRequest.&lt;init&gt;(OAuthRequest.java:52)
	org.apache.oltu.oauth2.as.request.OAuthAuthzRequest.&lt;init&gt;(OAuthAuthzRequest.java:43)
	com.arcusys.learn.controllers.oauth.InitializeApiController$$anonfun$1.apply(InitializeApiController.scala:22)
	org.scalatra.ScalatraBase$class.org$scalatra$ScalatraBase$$liftAction(ScalatraBase.scala:250)
	org.scalatra.ScalatraBase$$anonfun$invoke$1.apply(ScalatraBase.scala:245)
	org.scalatra.ScalatraBase$$anonfun$invoke$1.apply(ScalatraBase.scala:245)
	org.scalatra.ScalatraBase$class.withRouteMultiParams(ScalatraBase.scala:321)
	org.scalatra.ScalatraServlet.withRouteMultiParams(ScalatraServlet.scala:49)
	org.scalatra.ScalatraBase$class.invoke(ScalatraBase.scala:244)


As you can see, the exceptions are from org.apache.oltu.oauth2 package...it seems a OAuth 2.0 implementation....correct?




Could you please clarify when do you get this OAuth exception?
What are you trying to do just before it happens?
Niccolò Pasquetto, módosítva 9 év-val korábban

RE: Valamis ELearning: DB and OAuth questions

New Member Bejegyzések: 13 Csatlakozás dátuma: 2013.04.11. Legújabb bejegyzések
I viewed this exception during the init phase, but following the messages i received, i figured out how to complete the init phase and then get the access token (I can post the sample code), but I'm not able to call the TincanApi (for example the statements API). I've added the Authorization header valorized with Bearer {access-token-value} but I recived a 400 (Bad request).

I need to add some record to the LSR from an external system through the TincanApi.
Yulia Glushonkova, módosítva 9 év-val korábban

RE: Valamis ELearning: DB and OAuth questions

New Member Bejegyzések: 2 Csatlakozás dátuma: 2013.06.03. Legújabb bejegyzések
Niccolò Pasquetto:
but I'm not able to call the TincanApi (for example the statements API). I've added the Authorization header valorized with Bearer {access-token-value} but I recived a 400 (Bad request).


Hello! Except 400 error in responce there also should be a description what parameter is missed or wrong. Can you please send example statement which you try to send and we will check it?
Niccolò Pasquetto, módosítva 9 év-val korábban

RE: Valamis ELearning: DB and OAuth questions

New Member Bejegyzések: 13 Csatlakozás dátuma: 2013.04.11. Legújabb bejegyzések
Yulia Glushonkova:
Except 400 error in responce there also should be a description what parameter is missed or wrong


Hello and thanks for the response!

Unfortunately there is no description in the response so I have debugged the source code to understand where was the problems and finally I was able to correctly call the TincanApi Statements service.

Now I haven't got the source code with me, when I will come back to office i will put it in this thread.

Another question: I used the apache http-client library for the OAuth and for the TincanAPI, there is some other (stable) alternative libraries that implement those standards and the simplify the work?

Thank you, Niccolò
Yulia Glushonkova, módosítva 9 év-val korábban

RE: Valamis ELearning: DB and OAuth questions

New Member Bejegyzések: 2 Csatlakozás dátuma: 2013.06.03. Legújabb bejegyzések
Niccolò Pasquetto:

Another question: I used the apache http-client library for the OAuth and for the TincanAPI, there is some other (stable) alternative libraries that implement those standards and the simplify the work?


Sorry unfortunatelly we can't advice you any other library.