New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subclass inherited from OpenIddict classes #360
Comments
The sample was downloaded on Dec 27, 2016. |
Hey, To be honest, I'm not sure I clearly understand what the problem is. It would likely help if you could share a repro showing what's wrong and what's expected. |
Sorry, that is not enough clear. I want to check a process of request from client. When debug sample step by step, OpenIddictProvider.SerializeAuthorizationCode and SerializeRefreshToken create and store a token in table openiddicttoken. I didn't add new process code, only migrate sample and create four classes. |
I just tried on my machine, with the latest OpenIddict bits and it worked fine: public class CustomApplication : OpenIddictApplication<long, CustomAuthorization, CustomToken> { }
public class CustomAuthorization : OpenIddictAuthorization<long, CustomApplication, CustomToken> { }
public class CustomScope : OpenIddictScope<long> { }
public class CustomToken : OpenIddictToken<long, CustomApplication, CustomAuthorization> { } services.AddDbContext<ApplicationDbContext>(options =>
{
// Configure the context to use Microsoft SQL Server.
options.UseSqlServer(configuration["Data:DefaultConnection:ConnectionString"]);
// Register the entity sets needed by OpenIddict.
// Note: use the generic overload if you need
// to replace the default OpenIddict entities.
options.UseOpenIddict<CustomApplication, CustomAuthorization, CustomScope, CustomToken, long>();
}); // Register the OpenIddict services.
services.AddOpenIddict<CustomApplication, CustomAuthorization, CustomScope, CustomToken>()
// Register the Entity Framework stores.
.AddEntityFrameworkCoreStores<ApplicationDbContext>()
// ... |
|
I have checked my code some times, it's depressing to find no different. However the other error appeared also. I believe that's my unknow mistake. So I resolve to update new version and rewrite my this practice. Besides, If you don't mind, I should redefine four classes(application, authorization, scope, token) and relations. The modified part will be shared with you finally. Thank you for all. (●'◡'●) |
Hello, Kevin.
Some days ago, I found OpenIddictToken can't be store in db. Then I misunderstood that it caused by PK type in class, and asked you in gitter.
However, the question was not to end. When I go on learning this project recently, it happened again that record was empty in table OpenIddictToken in the process of request. But the PK type of all classes is '
string
', and request could finish very well.So, I ran core sample well. All requests could new and store a token record.
(BTW, in sample project the refresh token can not be deleted after logout, every request will leave it in the end.)
Their difference is the classes, such as Application and so on, inherited from original classes.
I'm not sure whether that's right to inherit those classes.
Please guide me, thank you very much.
The text was updated successfully, but these errors were encountered: