Please help me understand the following. I decided...
# singer-tap-development
a
Please help me understand the following. I decided to use the OAuthAuthenticator class and create my own custom authenticator So I add two methods oauth_request_body and create_for_stream Then when I ran it I immediately got an error The question is why can't I use the config in this place?
r
config
is an instance (
self
) property, not a class (
cls
) property so you cannot access it like that. You need to override the
auth_endpoint
property in your authenticator class like this: https://github.com/Matatika/tap-auth0/blob/8e3097a3ce4e908c0c8a4db41b28e63f9804c46e/tap_auth0/auth.py#L13-L15
Feel free to use the tap as a reference.
a
thank you man!
again errorsπŸ˜Άβ€πŸŒ«οΈπŸ˜ͺ
message has been deleted
How can I properly debug authorization? I can't find the moment at which authorization occurs
r
You can inspect the request from a response with
Response.request
, so you could log that out wherever appropriate. From that error, it sounds like maybe you've configured your
client_id
config as
secret
, which will interpret the value as a `SecretString` instance (as opposed to a
str
). All you need to do in this case is ensure you are casting the value of
client_id
to
str
in your
auth_headers
and
http_headers
implementations, or don't make
client_id
a
secret
(a client ID probably doesn't need to be anyway).
a
does this mean I have to do the same with the username and password in the oauth request body function? I made it a secret temporarily so that I can test how it works (probably for username and password I won't get this error because it's a request body)
I debug it and i see that password also is sectret in oauth_request_payload (in sdk)
message has been deleted
message has been deleted
r
Can you make the same request successfully through Postman or similar?
a
yes sure. (But I need to get a token first)
So 1. Get bearer token from /cwa/api/v1/apitoken 2. Use Token from point 1 for each request (expired after 1 hour - then need refresh) But for now i try to get some data without refresh
Now during the debug, I can't catch the request moment when it tries to request a token (it seems to me that the singer cached my class got an error and now every time it starts, it no longer tries to receive a token How do I understand that the request is not happening? The debugger stopped entering the oauth_request_body function