MFA API Bearer token issue
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- ruby
- Área
- api, authentication
Línea de trabajo
Comienza con lib/auth0/mixins/httpproxy.rb#L95 y sigue cómo se gestionan extra_headers para las solicitudes POST a través de request_with_retry. Compara esa ruta con lib/auth0/api/authentication_endpoints.rb y verifica que un MFA Bearer token pueda sobrescribir o proporcionar el encabezado de la solicitud; se considera terminado cuando la llamada a la API de MFA reportada envía el token previsto.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Checklist
- I have looked into the Readme and Examples, and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Description
I found what it seems an issue while trying to interact with the MFA API for testing purposes, to test this API I decided to monkey patch the https://github.com/auth0/ruby-auth0/blob/master/lib/auth0/api/authentication_endpoints.rb module, this was the easiest way to interact with the MFA API using existing mechanisms (If this works and is something that makes sense including in the gem I'd love to implement a better solution and create a PR), continuing with the issue and because of how MFA endpoints work when a user does not have an authenticator method, I need to pass the mfa_token I get with the mfa_required error type in the Bearer header, this was not working and after some investigation I figured out that extra headers when making POST API calls do not work, the gem does not take extra_headers into account in that case https://github.com/auth0/ruby-auth0/blob/master/lib/auth0/mixins/httpproxy.rb#L95, I'd like to understand if that's something that makes sense implementing and if that's the case I'm available to create a PR to cover that use case.
Here just a snippet of the monkey patch I described above to associate a new MFA
module Auth0
module Api
module AuthenticationEndpoints
def mfa_otp_associate(client_id: @client_id, client_secret: @client_secret, mfa_token:)
request_params = {
client_id: client_id,
client_secret: client_secret,
authenticator_types: ['otp']
}
request_with_retry(:post, '/mfa/associate', request_params, { 'Authorization' => "Bearer #{mfa_token}" })
end
end
end
end
If the client object already has a Bearer header it will use that one and not the one I'm passing.
Please let me know if you need more information to understand my use case with the MFA API.
Reproduction
There is no easy way to reproduce this without interacting with the MFA API.
Additional context
No response
ruby-auth0 version
5.16.0
Ruby version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
- Lenguaje dominante
- Ruby
- Estrellas
- 205
- Forks
- 146
- Merge medio
- 16 h 2 min
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de auth0/ruby-auth0
-
feature request
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
auth0/ruby-auth0#709 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 50/100
auth0/ruby-auth0#610 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Rate limit data returned from API methodsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertofeature request
Dificultad 5/5 Más de una semana Aptitud para principiantes 32/100
auth0/ruby-auth0#606 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
feature request
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
auth0/ruby-auth0#500 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Move from `rest-client` to `faraday`?Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertofeature request
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
auth0/ruby-auth0#483 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de auth0/ruby-auth0
Issues similares
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
bridgetownrb/bridgetown#1130 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
stripe/stripe-ruby#1994 ·
Los mantenedores suelen responder en 1 día
-
[Fehler]: /abdeckstift wirft 500 — part_type aus der Phonemreduction-Umbenennung nicht mitgezogenAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
wort-schule/wort.schule#787 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
lugassawan/swe-workbench#799 ·
Los mantenedores suelen responder en 1 día
-
2.8.6: NoMethodError "undefined method 'first'" in profdata_coverage_dir whenever --scheme is usedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
SlatherOrg/slather#586 · 2 comentarios ·