saml2aws icon indicating copy to clipboard operation
saml2aws copied to clipboard

Challenge selection fix

Open aaronthebaron opened this issue 1 year ago • 6 comments
trafficstars

aaronthebaron avatar Jun 06 '24 17:06 aaronthebaron

@edwardrf I don't know if this helps you at all, but in this branch I put some basic work into fixing the issue you're running into with change of selection.

When you enter googleapps.go:83 you're failing out to the bottom at googleapps.go:449

Instead, I think we need to catch the error and try to look at this selection page, so in this branch I added a new function and an if block to try and catch your new selection page.

The new selection page is the html that is added to tests in this PR. I think the key is figuring out which of this attributes needs to be passed to the page:

<div class="mimsib SmR8" jsname="EBHGs" data-challengeid=11 data-action=selectchallenge data-accountrecovery="false" data-challengetype="39">

aaronthebaron avatar Jun 06 '24 17:06 aaronthebaron

Thanks @aaronthebaron, I did took a look at the page and tried to select the one-time code method, but it seems it always ends up sending me to the SMS challenge page. I'll have to circle back to see what could be the reason. Code change here: https://github.com/edwardrf/saml2aws/commit/864417090e7dd537036519431c6bfb8836e1ad92

edwardrf avatar Jun 06 '24 20:06 edwardrf

@edwardrf Thanks for taking a swing at it. I fixed captcha's today and will take a look at your changes on Monday if you don't beat me to it.

aaronthebaron avatar Jun 07 '24 21:06 aaronthebaron

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.

Project coverage is 42.05%. Comparing base (99d6fe4) to head (5a90874). Report is 158 commits behind head on master.

Files with missing lines Patch % Lines
pkg/provider/googleapps/googleapps.go 0.00% 22 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1286      +/-   ##
==========================================
- Coverage   42.19%   42.05%   -0.15%     
==========================================
  Files          54       54              
  Lines        6456     6478      +22     
==========================================
  Hits         2724     2724              
- Misses       3283     3305      +22     
  Partials      449      449              
Flag Coverage Δ
unittests 42.05% <0.00%> (-0.15%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Jun 07 '24 22:06 codecov-commenter

@edwardrf I think I see what's happening with your code. I think two elements are required, a challengeId and a challengeType. You have one but not the other.

The types also appear to be in the HTML

<div class="mimsib SmR8 RDPZE" jsname="EBHGs" data-challengeid=10 data-action=selectchallenge data-challengeunavailable="true" data-accountrecovery="false" data-challengetype="2">

So it seems like you are on the right track?

aaronthebaron avatar Jun 10 '24 18:06 aaronthebaron

What is the plan for this PR?

mapkon avatar Jul 08 '24 21:07 mapkon