by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 14:12
    kevinchalet assigned #962
  • 14:12
    kevinchalet labeled #962
  • 14:12
    kevinchalet opened #962
  • 14:12
    kevinchalet milestoned #962
  • Jun 04 15:48

    kevinchalet on dev

    Use private claims for the toke… (compare)

  • Jun 04 15:48
    kevinchalet closed #961
  • Jun 04 15:11
    kevinchalet synchronize #961
  • Jun 04 14:38
    kevinchalet labeled #961
  • Jun 04 14:38
    kevinchalet assigned #961
  • Jun 04 14:38
    kevinchalet milestoned #961
  • Jun 04 14:38
    kevinchalet opened #961
  • Jun 04 06:42
    jonathanantoine commented #960
  • Jun 03 12:55
    kevinchalet commented #960
  • Jun 03 12:24
    jonathanantoine commented #960
  • Jun 03 12:22
    jonathanantoine closed #960
  • Jun 03 12:22
    jonathanantoine commented #960
  • Jun 03 12:13
    jonathanantoine commented #960
  • Jun 03 11:58
    kevinchalet labeled #960
  • Jun 03 11:58
    kevinchalet commented #960
  • Jun 03 10:34
    jonathanantoine opened #960
Kévin Chalet
@kevinchalet
Polling. Repeated token requests until the user validates the demand.
damccull
@damccull
to the tokens endpoint? With what parameters, my friend?
Kévin Chalet
@kevinchalet
The ones defined in the spec :smile:
damccull
@damccull
I shall find this spec. Standby.
OpenIddict handles device requests for you, but you’ll need to handle verification and token requests by providing custom actions.
Don’t hesitate to take a look at the MVC server sample.
damccull
@damccull
is urn:ietf:params:oauth:grant-type:device_code a standard for device code? Like do I use that for the grant type always?
Kévin Chalet
@kevinchalet
It is.
damccull
@damccull
Ok cool
it's a totally confusing string lol
Kévin Chalet
@kevinchalet
Hehe yeah :smile:
damccull
@damccull
Wow. this thing works perfectly.
Only thing I can't seem to find: On https://www.oauth.com/oauth2-servers/device-flow/token-request/ it says there's a polling interval. Where is that sent to me so I know when to poll next or how often?
Oh, i see. The spec says wait 5 seconds if none is provided.
Got it. I assume it's provided in the token endpoint response then
Kévin Chalet
@kevinchalet
Before each new request,
the client MUST wait at least the number of seconds specified by
the "interval" parameter of the device authorization response (see
Section 3.2), or 5 seconds if none was provided, and respect any
increase in the polling interval required by the "slow_down"
error.
damccull
@damccull
noice thanks man
does openiddict generate the interval or is that something I'd have to mod in to my app?
not that I need it, just curious
Kévin Chalet
@kevinchalet
There's currently no support for throttling.
damccull
@damccull
ok good to know. i figured while spamming my endpoint with postman waaaay faster than 5 seconds apart :D
Kévin Chalet
@kevinchalet
Not saying there's will no story for that, but it's hard to implement in distributed apps in a fairly efficient and reliable way.
lol
damccull
@damccull
@PinpointTownes https://gitlab.com/damccull/openiddict-razorpages/ here is the working example I have now using razorpages as endpoints. Why? Because it was easier than figuring out how to put MVC in there with razor pages. Plus I think it's cleaner if the rest of the site will be razorpages anyways :D
Kévin Chalet
@kevinchalet
lol
damccull
@damccull
So if you're interested in seeing how I did it, there you go
Kévin Chalet
@kevinchalet
I'll take a look.
damccull
@damccull
That's a razorpages translation of your dev branch MVC example
Kévin Chalet
@kevinchalet
Lord, Gitlab is so slow.
damccull
@damccull
Yeah that's not normal wtf
it was fast like 10 seconds ago
Also I left out the 'logout' page UI entirely by oops. So I'll fix that and reupload it too :D
Kévin Chalet
@kevinchalet
It doesn't look that bad, actually :sweat_smile:
damccull
@damccull
Well thanks.
I'd like to get GetDestinations out of each page cs file but I tried putting it in a static class and it complained about instance variables, of which I can't find any. I assume the 'yield' is causing that issue. I don't know enough about yield yet.
Kévin Chalet
@kevinchalet
Weird, it shouldn't cause that.
damccull
@damccull
It might not be yield, of course. I might just be missing something. I literally plagiarized the junk out of your code ;D
Kévin Chalet
@kevinchalet
:smile:
I'm not super familiar with Razor Pages. What are these properties used for? https://gitlab.com/damccull/openiddict-razorpages/blob/master/src/Areas/oidc/Pages/Token.cshtml.cs#L35-40
damccull
@damccull
return View(new VerifyViewModel
                {
                    ApplicationName = await _applicationManager.GetDisplayNameAsync(application),
                    Scope = string.Join(" ", result.Principal.GetScopes()),
                    UserCode = request.UserCode
                });
Kévin Chalet
@kevinchalet
You return views from the token endpoint? :confused:
damccull
@damccull
No, they might just be left over from copy/paste ;D
Kévin Chalet
@kevinchalet
Ah :smile:
damccull
@damccull
Yep they were. And are gone now. Pushing update.
Why does [OpenIddictServerAspNetCoreConstants.Properties.Error] have [] around it?
Kévin Chalet
@kevinchalet
It's C# 6's new dictionary initialization syntax.
damccull
@damccull
Interesting.
Kévin Chalet
@kevinchalet
[OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.InvalidGrant is the equivalent of { OpenIddictServerAspNetCoreConstants.Properties.Error, Errors.InvalidGrant } if you prefer that syntax.
Or Add(OpenIddictServerAspNetCoreConstants.Properties.Error, Errors.InvalidGrant).