Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sandbox/OpenIddict.Sandbox.AspNet.Client/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.Owin.Security.Cookies;
using OpenIddict.Client;
using OpenIddict.Client.Owin;
using OpenIddict.Client.WebIntegration;
using OpenIddict.Sandbox.AspNetCore.Server.Models;
using Owin;
using static OpenIddict.Abstractions.OpenIddictConstants;
Expand Down Expand Up @@ -95,7 +96,7 @@ public void Configuration(IAppBuilder app)
options.SetClientId("1016114395689-kgtgq2p6dj27d7v6e2kjkoj54dgrrckh.apps.googleusercontent.com")
.SetClientSecret("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")
.SetRedirectUri("callback/login/google")
.SetAccessType("offline")
.SetAccessType(OpenIddictClientWebIntegrationConstants.Google.AccessTypes.Offline)
.AddScopes(Scopes.Profile);
});
});
Expand Down
5 changes: 3 additions & 2 deletions sandbox/OpenIddict.Sandbox.AspNetCore.Client/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens;
using OpenIddict.Client;
using OpenIddict.Client.WebIntegration;
using OpenIddict.Sandbox.AspNetCore.Client.Models;
using Quartz;
using static OpenIddict.Abstractions.OpenIddictConstants;
Expand Down Expand Up @@ -152,15 +153,15 @@ public void ConfigureServices(IServiceCollection services)
options.SetClientId("1016114395689-kgtgq2p6dj27d7v6e2kjkoj54dgrrckh.apps.googleusercontent.com")
.SetClientSecret("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")
.SetRedirectUri("callback/login/google")
.SetAccessType("offline")
.SetAccessType(OpenIddictClientWebIntegrationConstants.Google.AccessTypes.Offline)
.AddScopes(Scopes.Profile);
})
.AddReddit(options =>
{
options.SetClientId("vDLNqhrkwrvqHgnoBWF3og")
.SetClientSecret("Tpab28Dz0upyZLqn7AN3GFD1O-zaAw")
.SetRedirectUri("callback/login/reddit")
.SetDuration("permanent");
.SetDuration(OpenIddictClientWebIntegrationConstants.Reddit.Durations.Permanent);
});

#if SUPPORTS_PEM_ENCODED_KEY_IMPORT
Expand Down
5 changes: 3 additions & 2 deletions sandbox/OpenIddict.Sandbox.Console.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using OpenIddict.Client;
using OpenIddict.Client.WebIntegration;
using OpenIddict.Sandbox.Console.Client;
using static OpenIddict.Abstractions.OpenIddictConstants;

Expand Down Expand Up @@ -104,7 +105,7 @@
// is discouraged practice, it is the only option to use this provider in a desktop client.
.SetClientSecret("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")
.SetRedirectUri("callback/login/google")
.SetAccessType("offline")
.SetAccessType(OpenIddictClientWebIntegrationConstants.Google.AccessTypes.Offline)
.AddScopes(Scopes.Profile)
.AddGrantTypes(GrantTypes.AuthorizationCode)
.SetProviderName("Google [code flow]")
Expand All @@ -115,7 +116,7 @@
options.SetClientId("1016114395689-le5kvnikv5hhg3otvn1tgs2aogpkpvff.apps.googleusercontent.com")
.SetClientSecret("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")
.SetRedirectUri("callback/login/google")
.SetAccessType("offline")
.SetAccessType(OpenIddictClientWebIntegrationConstants.Google.AccessTypes.Offline)
.AddScopes(Scopes.Profile)
.AddGrantTypes(GrantTypes.DeviceCode)
.SetProviderName("Google [device flow]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@

_ => throw new InvalidOperationException(SR.GetResourceString(SR.ID0473)) }}" />

<Constant Class="AccessTypes" Value="offline" Name="Offline" />
<Constant Class="AccessTypes" Value="online" Name="Online" />

<Constant Class="Regions" Value="China" Name="China" />
<Constant Class="Regions" Value="Global" Name="Global" />

Expand Down Expand Up @@ -1089,6 +1092,9 @@
Documentation="https://developers.google.com/identity/protocols/oauth2/openid-connect">
<Environment Issuer="https://accounts.google.com/" />

<Constant Class="AccessTypes" Value="offline" Name="Offline" />
<Constant Class="AccessTypes" Value="online" Name="Online" />

<Setting PropertyName="AccessType" ParameterName="type" Type="String" Required="false"
Description="The value used as the 'access_type' parameter (can be set to 'offline' to retrieve a refresh token)" />
</Provider>
Expand Down Expand Up @@ -1126,6 +1132,9 @@
<Environment Issuer="https://accounts.huawei.com/"
ConfigurationEndpoint="https://oauth-login.cloud.huawei.com/.well-known/openid-configuration" />

<Constant Class="AccessTypes" Value="offline" Name="Offline" />
<Constant Class="AccessTypes" Value="online" Name="Online" />

<Setting PropertyName="AccessType" ParameterName="type" Type="String" Required="false"
Description="The value used as the 'access_type' parameter (can be set to 'offline' to retrieve a refresh token)" />

Expand Down Expand Up @@ -1566,6 +1575,9 @@
<Scope Name="profile" Default="true" Required="true" />
</Environment>

<Constant Class="AccessTypes" Value="offline" Name="Offline" />
<Constant Class="AccessTypes" Value="online" Name="Online" />

<Setting PropertyName="AccessType" ParameterName="type" Type="String" Required="false"
Description="The value used as the 'access_type' parameter (can be set to 'offline' to retrieve a refresh token)" />

Expand Down Expand Up @@ -1844,6 +1856,9 @@
<Scope Name="identity" Default="true" Required="true" />
</Environment>

<Constant Class="Durations" Value="permanent" Name="Permanent" />
<Constant Class="Durations" Value="temporary" Name="Temporary" />

<Setting PropertyName="Duration" ParameterName="duration" Type="String" Required="false"
Description="The value used as the 'duration' parameter (can be set to 'permanent' to retrieve a refresh token)" />
</Provider>
Expand Down Expand Up @@ -2707,6 +2722,9 @@
<Scope Name="AaaServer.profile.READ" Default="true" Required="true" />
</Environment>

<Constant Class="AccessTypes" Value="offline" Name="Offline" />
<Constant Class="AccessTypes" Value="online" Name="Online" />

<Constant Class="Regions" Value="Australia" Name="Australia" />
<Constant Class="Regions" Value="Canada" Name="Canada" />
<Constant Class="Regions" Value="European Union" Name="EuropeanUnion" />
Expand Down