{"push_id":866192740,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"108608f98c55a00a0d49f26e6e894b7d41cd7b6a","before":"86c2752347d3164f2ea611ab97efb1fd20167676","commits":[{"sha":"108608f98c55a00a0d49f26e6e894b7d41cd7b6a","author":{"email":"422c6f6db4907fde52e42b03b990c6138fdd5b64@yahoo.com","name":"MadalinaOtvos"},"message":"Signed-off-by: MadalinaOtvos <otvos_madalina@yahoo.com>\nCanvasAPI needs the token to identify the user at each request and to replace the old password mechanism. Without the token, it doesn't works. The token have to be obtained per user only once at login time.\nAfter a bit of research, I found out how we can obtain the token in our case.\nI would separate the OAuth flow in 2 parts. The first part is when you obtain the 'code' by login, and the second is when you obtain the token by passing the previously obtained code as a parameter.\nAs a proof of example, the next steps will demonstrate how to use the given client_id, dev_key and redirect_uri.\n\nclient_id=10000000000002\ndev_key=ru1UrVTFK3mHtiiVHiZghZqWQXNg12oOjjNjAyTcFBmEjlxGXm6yes7Ho4iPxGfH\nredirect_uri=http://kikellcserelni {or: 'urn:ietf:wg:oauth:2.0:oob'} Signifying that the credentials will be retrieved out-of-band using an embedded browser or other functionality. See oAuth flow from Usefull_links file.\n\nCopy the following GET http request in your browser: https://canvas.cs.ubbcluj.ro/login/oauth2/auth?client_id=10000000000002&response_type=code&redirect_uri=http://kikellcserelni\nYou will be asked to login. If you log in successfully you will be asked to Allow 'DevLehel' access to your account. After you allow this, you will be redirected to a url where you will get the code in the header url. I.E. https://canvas.cs.ubbcluj.ro/login/oauth2/auth?code=e6f7f15f683c5a663646f0cc78bb85f3d93b6d8325ec0dcecc22e5f3efca2056e74cead8c892849557f45f9543e63c6b49f239e1931cdaf0eaf03fa7a64f728b\nThe part after '?code=' is what you need to obtain the token with CanvasAPI. Copy the code, and paste it in the ExampleActivity to the variable authResponseCode.\nRun the project and you will see your courses that you have queried through canvas API.\n\nThe remaining issue here is that the first part, where you obtain the code is only working in the browser. The project already has a cookie storing mechanism at the LoginActivity. We probably have to create a separate window to grant 'DevLehel' access.\nAs a reseach, and an example to follow, this is a good starting point.\n\nI think that the existing login page should be used, because it already sends a login request to the server. Only a new View should be introduced for grant access for 'DevLehel'. This way after login the token will be generated.","distinct":true,"url":"https://api.github.com/repos/Csenge94/CanvasQuiz-ubbse2015/commits/108608f98c55a00a0d49f26e6e894b7d41cd7b6a"}]}