-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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 captcha to BMW ConfigFlow #131351
Add captcha to BMW ConfigFlow #131351
Conversation
Hey there @gerard33, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
How does the user retrieve the capcha for their region? Update: Nevermind, I figured this out. Tested and working. Thank you!
|
Tried it also "rest of world" region, but i receive: after copy paste the token: |
Do you have the latest |
yes, i added:
|
try installing the standard (not the china version) in the the root of the |
hmm, that didnt help , i test later again, thnx |
Thanks for testing. Some issues I stumbled accross while building/testing:
@pergolafabio It seems as if your environment isn't fully set up. E.g. you do not have any translations available. Unfortunately, the BMW API doesn't give any more specific feedback than "Invalid login". |
hey @rikroe , indeed its working again! Seems for some reason, the login on mybmw website wasnt working anymore, i had todo a reset there ... strange, cause i was still logged in in the bmw app |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
How about directing the user how to obtain the token and adding a UI element to add the token? The small indirection shouldn't be a huge trouble in addition to providing the regular user credentials in the configuration dialog and no external JS is required. |
Thats what this PR does. |
Nerver mind then. I haven't read the PR itself, but the title and the discussion are very misleading. A captcha is a test whether there's a human on the other end, a token is of proof of validity/identity. Your PR description itself says you weren't sure if the rendering of the captcha page would be permissible (and as it turns out -- this won't be accepted). Adding an input field for a token is a completely different thing and done by various integrations im HA already. May I humbly suggest changing the title of the PR to avoid confusion about the actual current proposal? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the patience and cooperation @rikroe 👍
Looks good to me; let's ship it.
../Frenck
PS: For the reader who is wondering:
"Cool... but how do I install this?"
Well, it is being merged into the 2024.12 release, which will become generally available on December 4th, 2024. If you want to try it out sooner, you can opt-in to join our beta releases.
Co-authored-by: Franck Nijhof <git@frenck.dev>
Thanks for the support @frenck! |
Proposed change
BMW have implemented a captcha solution for the North America and Rest of World regions when logging in for the first time using username & password.
Once logged in and using refresh tokens, the captcha is not required anymore.
This PR adds an additional to the config flow where the user can retrieve the captcha for his region.
If during normal operation, the refresh token flow fails, a reauthentication flow with a captcha-specific error message will be triggered.
Additional information
This PR is a second iteration on this topic, please see #129667 for previous discussions.
Ideally, I would have liked to implement the external captcha page (a simple HTML page with some HTML, see e.g. at bimmer_connected/docs/source/captcha/north_america_form.html to be included as external view, however I am not sure if this would be allowed.
If this change can be accepted by the Core team, I will create a docs PR accordingly.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: