FusionAuth / fusionauth-python-client

FusionAuth Python Client
https://fusionauth.io
Apache License 2.0
24 stars 12 forks source link

Some endpoints missing #8

Closed AliMirlou closed 3 years ago

AliMirlou commented 3 years ago

Hi, I might have understood the protocols wrong but I was looking for the introspect endpoint in the client with no luck. Why is it and some other endpoints missing? Are they not needed in backends perhaps?

robotdan commented 3 years ago

It is not currently in the client libraries. We can look at adding it.

AliMirlou commented 3 years ago

Isn't it an essential endpoint?

mooreds commented 3 years ago

Hiya,

You can definitely access it, just not through the client libraries. Here's some documentation about how to do so: https://fusionauth.io/docs/v1/tech/oauth/endpoints#introspect You can use a python HTTP library to create the POST request.

If you are only working with OAuth, you could also use any of the standard OAuth libraries. For this example app I used a mix of the FusionAuth client libraries and requests_oauthlib: https://github.com/FusionAuth/fusionauth-example-flask-portal

robotdan commented 3 years ago

I'm not against adding it to the client libs.

See commits https://github.com/FusionAuth/fusionauth-client-builder/commit/12569fdc46cba8f3f87c5498895696dac41bef23 and https://github.com/FusionAuth/fusionauth-python-client/commit/62fab4bbf9434572a63be1d47bec6978bc1d8ac3

I haven't tested this yet... @AliMirlou feel free to see how it works.

@mooreds or @AliMirlou any feedback on the method name?

mooreds commented 3 years ago

I'd probably call it o_auth_introspect for consistency (there are only a few other methods that reference oauth in the name, but one of them uses that clunky string).

robotdan commented 3 years ago

Yeah, normally we wouldn't mention oauth2 but since this is a really specific method I didn't know what else to call it.

I am fine with o_auth_introspect but it is (technically) an OAuth2 thing and not related to OAuth1 (I don't think anyway). But perhaps there is no confusion here since we don't support OAuth v1 at all.

robotdan commented 3 years ago

@AliMirlou any opinion on a name that suites the method, and is also "python-y" :-)

AliMirlou commented 3 years ago

@robotdan IMHO, I suggest introspect_access_token so that it can relate more to all the other method names like exchange_o_auth_code_for_access_token or validate_device which start with a verb. All of the method names suggested in this issue are pythony though, so no comments on that. 😄

robotdan commented 3 years ago

I think we have a winner! introspect_access_token it is. Thanks for the feedback @AliMirlou .

robotdan commented 3 years ago

Available in master and 1.19.8 https://pypi.org/project/fusionauth-client/