Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error codes in PRONOTE protocol.md #267

Open
XibalbaM opened this issue Sep 19, 2023 · 18 comments
Open

Add error codes in PRONOTE protocol.md #267

XibalbaM opened this issue Sep 19, 2023 · 18 comments

Comments

@XibalbaM
Copy link

Hi ! I'm trying to make an equivalent to this lib in kotlin, but I'm struggling with "Identification" request. I can do "FonctionParametres" request without problems but with this one I can't achieve it. My json body is good, it matches the one used by the website. But I get an error:
{"Erreur":{"G":14,"Titre":"La page a expir\u00E9 ! (7)","Message":""}}
And I can't find why. That's why it could be good to add an explanation on errors in PRONOTE protocol.md

@bain3
Copy link
Owner

bain3 commented Sep 19, 2023

I'd love to, but I have no idea what most of the error codes mean... The best I've got is this enum from eleve.js:

const EGenreErreurAcces = {
    Aucune: 0,
    Identification: 1,
    Autorisation: 2,
    ConnexionClasse: 3,
    AucuneRessource: 4,
    Connexion: 5,
    BloqueeEleve: 6,
    FonctionAccompagnant: 7,
    AccompagnantAucunEleve: 8,
    Message: 9,
    CompteDesactive: 10
};

@XibalbaM
Copy link
Author

Okay thanks

@OmegaMax
Copy link

@XibalbaM We have the same problem too, for the fonction parametre there's no problem, but for Identification we get the same error. We don't know why it happens but you can review the encryption or something like that, because if you haven't any prblms with Fonction Parametres, that's mean your Uuid is good but you don't need to encrypt because the Nordre is the also the same for all of first requests. You need to encrypt with the bytes generated that help to generate the uuid as the documentation says, we tried it but no result, keep searching...

@bain3
Copy link
Owner

bain3 commented Sep 23, 2023

There was a mistake in the protocol description. Fixed in 0cd9696. (you can see the implementation here)

Sorry for the confusion.

@OmegaMax
Copy link

Thanks !

@XibalbaM
Copy link
Author

Yeah after hours of trying I finally got it working, I have support for basic pronote connection for the moment. The thing that gave me the most of my problems was strangely the handling of bytes/string/hex and the encryption function not working exactly the same way as in python and JavaScript
For the moment my lib is tested only for kotlin but I hope I'll have support for JavaScript too soon
https://github.com/XibalbaM/PronoteKt

@OmegaMax
Copy link

We are trying in javascript and we are stuck, since... too long...

@XibalbaM
Copy link
Author

The code is public ? Maybe I can help. Else with kotlin multiplatform I'll be able to publish the same code for Java-Based, JavaScript and C-Like (using native libraries)
That's why I made it with kotlin, because it's the best for compatibility across many languages

@OmegaMax
Copy link

Sorry for the late answer it was night, hum, the code is not public enought but we will share you if we have no idea because we want to test something, we will tell you later ! Thanks to purpose your help

@OmegaMax
Copy link

We have finally success !

@OmegaMax
Copy link

@bain3 I think you can add that the G: 14 error is from the fact that we use the http model (in the doc, so with the rsa) instead of https model when we need https
It's just a hypothesis

@XibalbaM
Copy link
Author

XibalbaM commented Sep 25, 2023

I wrote that (it's just what I saw, not necessarily exact)
https://github.com/XibalbaM/PronoteKt/blob/master/src/main/kotlin/INFOS.md

@OmegaMax
Copy link

Hum, I don't know why, my code is just illogical and it works : I send by mistake the third request to do, so the identification request instead of Uuid request, so I send it two times and I don't know why it works, I have a succeful answer with the challenge. And all of it was made without the request with Uuid. Do you know why ?

@OmegaMax
Copy link

OmegaMax commented Sep 27, 2023

And then I try to do exactly the same thing for auth because I was curious that why its working. And I send also the request (without challenge, just the identification) and it replies something without solved challenge but juste "Acces : 1" but there's no errors, it's very strange...

@XibalbaM
Copy link
Author

I think the API isn't meant to be used by strangers so it explains why the errors are so random

@OmegaMax
Copy link

it's strange because if I use the classical way it doesn't works

@OmegaMax
Copy link

OmegaMax commented Oct 1, 2023

Idk if you have this error but I found it : G 23 : 'Vous avez dépassé le nombre d'erreurs d'authentification autorisées.\nVeuillez patienter avant de réessayer.'

@OmegaMax
Copy link

OmegaMax commented Oct 1, 2023

and also : Erreur:
{G: 9, Titre: 'La page a expiré ! (2)', Message: ''} when you skip a step i think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants