Giter Club home page Giter Club logo

Comments (7)

wp99cp avatar wp99cp commented on June 9, 2024 2

The whole thing is connected with the changeover of the Postcard Creator Webpage. This is now hosted on https://service.post.ch/pccweb/public/ui/view/home. See official info mail:

Der PostCard Creator zieht um und folgt der neusten Technik. Mit diesem Schritt ändert sich für Sie wenig. Sie finden PostCard Creator weiterhin unter der gewohnten Adresse. Dieser Umzug bedingt jedoch, dass Sie Altes zurücklassen, dafür aber von neuen Gestaltungsmöglichkeiten profitieren werden – und das ist erst der Anfang. Was bedeutet das für Sie? Ihre alten Entwürfe und Mailings können wir nicht mitnehmen und Sie haben ab dem 22. Juni 2021 keinen Zugriff mehr auf Ihre bisher gestalteten Postkarten.

At the same time, the old API was shut down. As was already the case for the SwissID Sign in, we have to adapt the API calls to the new API; this should not be a problem, since we can use the same calls as for the swissID sign-in. The only "new thing" / "bug to fix" is to change the sign-in process in order to obtain a valid token for the new API with the legacy sign-in method.

from postcard_creator_wrapper.

wp99cp avatar wp99cp commented on June 9, 2024 1

I've tried to implement the new sign-in process. It works analogously to the SwissID sign-in. Except it used swiss posts internal IDP instead of the external SwissID IDP. But in the end, I get an error: Access denied by resource owner or authorization server.

@abertschi you have implemented the SwissID sign-in process, right? Did you encounter a similar error during your implementation? And do you know how to fix this error? It's probably some cookies that are missing.

Link to my code (reproducing the error): https://gist.github.com/wp99cp/2b1ef687a39f47c495e34a5e5bde764f

from postcard_creator_wrapper.

abertschi avatar abertschi commented on June 9, 2024

Can you verify that the account producing above exception successfully works on the official website? After too many failed login attempts an account usually gets blocked and must be unblocked on https://service.post.ch/pccweb/public/ui/view/home via login.

Traceback (most recent call last):
File "c:\temp\venv\lib\site-packages\postcard_creator\token.py", line 276, in _get_access_token_swissid
url = resp.json()['nextAction']['successUrl']
KeyError: 'nextAction'

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "c:\temp\venv\lib\site-packages\postcard_creator\token.py", line 129, in fetch_token
raise e
File "c:\temp\venv\lib\site-packages\postcard_creator\token.py", line 123, in fetch_token
access_token = self._get_access_token_swissid(session, username, password)
File "c:\temp\venv\lib\site-packages\postcard_creator\token.py", line 279, in _get_access_token_swissid
raise PostcardCreatorException("failed to login, username/password wrong?")
postcard_creator.postcard_creator.PostcardCreatorException: failed to login, username/password wrong?

The exception does not say much. The Token class probably tried to login with legacy credentials (if method=mixed as default,

def fetch_token(self, username, password, method='mixed'):
) and falls back to swissid if legacy fails. swissid login attempt then fails with your aforementioned message.

from postcard_creator_wrapper.

davidoesch avatar davidoesch commented on June 9, 2024

attached the logging output (trace mode)
log_pc.txt

BTW it stopped working on June 21 --seems like post changed sth

from postcard_creator_wrapper.

abertschi avatar abertschi commented on June 9, 2024

Thanks for shouting out. I verified the issue with a legacy account. You are right, legacy token method does currently not work anymore.

You now have three options:

  • upgrade your account to swissid
  • wait until the issue is fixed. However, given that many accounts use swissid now, this issue has low priority for me.
  • contribute with a bugfix :)

from postcard_creator_wrapper.

davidoesch avatar davidoesch commented on June 9, 2024

Thx for confirming.
I have several Legacy accounts. Will try to switch to swissid ( but I doubt that I can have more than one Account …. For different projects)
Swissid is a little bit cumbersome—- not that widespread in use ( e-I’d discussion)

thx for all the work you’ve done so far

from postcard_creator_wrapper.

abertschi avatar abertschi commented on June 9, 2024

#34

from postcard_creator_wrapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.