Hi Richard,
You may care to know that there has been some activity around that area
recently, and some community members are investing time and effort to
provide friendlier endpoints for plugins that store credentials (like
basic-auth).
As of today, we've just merged #2955:
https://github.com/Kong/kong/pull/2955
Which introduces the following endpoint for key-auth:
/key-auths/:credential_key_or_id/consumer
This endpoint can be used to retrieve a Consumer from a Key credential's
'key', or 'id'.
The author, @hbagdi also volunteered to implement the same endpoint for
other plugins, including basic-auth. You can find the PR here:
https://github.com/Kong/kong/pull/2998
You may care to comment or give your thoughts in the PR thread :)
Regards,
Thibault
On 9/20/17 4:46 PM,
ric...@zschech.net wrote:
> Good question, my initial reaction would be to only the basic-auth
> credentials in question as it is only that email that would go through
> the verification and password reset process. If needed it would be
> simple enough to update all the other basic-auth credentials, if I can
> determine the consumer id, by querying kong for
>
http://kong:8001/consumer/xxx/basic-auth, looping over the result and
> then patching the password.
>
> The problem still stands as how to query kong for the consumer id xxx
> given the email address.
>
>
>
>
> On Wednesday, September 20, 2017 at 5:03:17 PM UTC-4, Cooper Marcus wrote:
>
> If the consumer with email address
a...@123.com <javascript:> went
> through the "forgot password" flow you are seeking, would you expect
> that the password associated with all their basic-auth credentials
> be changed? Or just one of those credentials? If all their
> credentials, would they all get the same password, or different
> passwords?
>
> On Wed, Sep 20, 2017 at 1:43 PM, <
ric...@zschech.net <javascript:>>
>
httpbin.org/get <
http://httpbin.org/get>, enable
> <
http://consumer.id> =
> basicauth_credentials.consumer_id where
> basicauth_credentials.username = "
b...@example.com"
>
> Currently Kong doesn't do this join. It does two
> lookups, on for the basicauth_credentials by
> username, then the other by consumer by the
> consumer_id. Have you looked at how
> basic-auth/access.lua gets the consumer for the
> basic auth username?
>
> I need to lookup the consumer's username based
> on a given basicauth_credentials.username.
>
>
>
>
> On Monday, September 18, 2017 at 7:38:43 PM
> UTC-4, JP Keenan wrote:
>
> Hi Richard-
>
> Thanks, I think I understand what you are
> trying to do now. When you create a user
> with basic Auth, a new table is added to
> your DB that holds the following records:
> |
> id uuid,
> consumer_id uuid REFERENCES
> consumers (id)ON DELETE CASCADE,
> username text,
> password text,
> created_at timestamp without time
> zone default(CURRENT_TIMESTAMP(0)at time
> <
http://www.google.com/url?q=http%3A%2F%2Fkong%3A8001%2Fconsumers&sa=D&sntz=1&usg=AFQjCNE-1tJlYUe4wEZ5XX9J8wdJsJNayQ> doesn't
> <
http://kong:8001/consumers>
>
> -JPK
>
>
> On Tuesday, September 5,
> 2017 at 9:39:33 AM UTC-7,
>
ric...@zschech.net wrote:
>
> Hi,
>
> I implementing a user
> forgot password
> workflow. Given the
> user's basic auth
> username (email address
> in my case) how do I get
> the consumer username? I
> don't see any CRUD API
> to get this information.
> The consumer username
> and basic auth username
> are not the same in my case.
>
> I can query by basic
> auth username with:
>
>
http://kong:8001/consumers/xxx/basic-auth?username=f...@example.com
> <
http://kong:8001/consumers/xxx/basic-auth?username=f...@example.com>
>
> But I don't know what
> xxx is.
>
>
http://kong:8001/consumers/basic-auth?username=f...@example.com
> <
http://kong:8001/consumers/basic-auth?username=f...@example.com>
> <
https://groups.google.com/group/konglayer>.
> <
https://groups.google.com/d/msgid/konglayer/3385ea17-00e0-4656-a03f-7618161ab649%40googlegroups.com?utm_medium=email&utm_source=footer>.
> <
https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the
> Google Groups "Kong" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to
konglayer+...@googlegroups.com <javascript:>.
> <javascript:>.
> <
https://groups.google.com/group/konglayer>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/konglayer/dbaea7e7-96cb-4ca8-9477-a3bd474a4b81%40googlegroups.com
> <
https://groups.google.com/d/msgid/konglayer/dbaea7e7-96cb-4ca8-9477-a3bd474a4b81%40googlegroups.com?utm_medium=email&utm_source=footer>.
> <
https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Kong" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
konglayer+...@googlegroups.com
> <mailto:
konglayer+...@googlegroups.com>.
> <mailto:
kong...@googlegroups.com>.
>
https://groups.google.com/d/msgid/konglayer/0580abd1-f600-4f0b-93d4-55fb5552e7fc%40googlegroups.com
> <
https://groups.google.com/d/msgid/konglayer/0580abd1-f600-4f0b-93d4-55fb5552e7fc%40googlegroups.com?utm_medium=email&utm_source=footer>.