These are chat archives for WildGums/Orc.LicenseManager

21st
Apr 2016
Colin
@cuken
Apr 21 2016 14:46
@GeertvanHorrik Do you have a quick start guide available to integrate this?
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 14:47
Hi Colin, not really.
Colin
@cuken
Apr 21 2016 14:47
I'm going through the code and trying to figure out where to even start )
:)*
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 14:47
I know, do you want server or client?
server is already there in the example, etc
so if you want to check for a license on your client, you need:
  1. at startup, call this code:
    if (!await _simpleLicenseService.Validate(License.ApplicationId, "My Product", "/MyProduct;component/Resources/Images/logo_0128.png", "In order to use this software, a license is required.")())
    {
     // License is not valid, exit software
    }
Colin
@cuken
Apr 21 2016 14:48
Both, I have a simple implemntation of Rhino Licensing, but I didn't see any easy way to integrate hardware locking. So I stubmled on your project and looking at what it would take to get it to work
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 14:48
License.ApplicationId => the public key
to generate a license, just take a look at Portable.Licensing: https://github.com/dnauck/Portable.Licensing
There you see how to create a private and public key and generate a license
Colin
@cuken
Apr 21 2016 14:50
Does the server example provided have the ability to generate a license?
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 14:50
yep
we built our own server based on that example
Colin
@cuken
Apr 21 2016 14:50
okay I'll spend some time digging into it there's a lot going on :)
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 14:51
Yes, it's a bit of a complex solution, but since it's working for us we don't spend a lot of time improving the getting started guide (too much on our plate already)
If you have any questions, just ping me here
Colin
@cuken
Apr 21 2016 14:51
Have you guys integrated payment solutions to trigger creation events?
Like a paypal purchase
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 14:52
No, because we don't need that (we create licenses manually). But it would be fairly easy (since there is a LicenseGeneratorService that you can call from your paypal callback url)
Colin
@cuken
Apr 21 2016 14:54
Ok thanks for your time! I'll ping you if I have any questions
Colin
@cuken
Apr 21 2016 20:16
@GeertvanHorrik Finally had some time to test it, when I try to launch the server in debug, it's throwing an exception on context.Database.CreateIfNotExists();
An exception of type 'System.Data.SqlClient.SqlException' occurred in EntityFramework.SqlServer.dll but was not handled in user code

Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 20:18
You need a sql database (can be sql express)
the connection string is in web.config if I remember correctly
Colin
@cuken
Apr 21 2016 20:18
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\LicenseManager.mdf;Initial Catalog=LicenseManager;Integrated Security=True" providerName="System.Data.SqlClient" />
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 20:21
can you rename the mdf file in the appdata directory? Then it can create a new one
Colin
@cuken
Apr 21 2016 20:22
just did, we'll see what happens
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 20:23
You could also point to a local sql database (sql express), that's easier than the files (at least that's my experience)
Colin
@cuken
Apr 21 2016 20:28
Something like this? <add name="DefaultConnection" connectionString="Server=localhost;Database=LicenseManager;Trusted_Connection=True;"/>
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 20:30
Something like this:
providerName="System.Data.SqlClient"
    connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=DatabaseName;Integrated Security=True;MultipleActiveResultSets=True"/>
Colin
@cuken
Apr 21 2016 20:32
WOO HOO I got it to render!
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 20:32
nice, good job
Colin
@cuken
Apr 21 2016 20:32
Does it create the database with a default username/pass?
Geert van Horrik
@GeertvanHorrik
Apr 21 2016 20:32
I think so yes
Colin
@cuken
Apr 21 2016 20:40
Unless I'm reading this wrong , I see the AspNetUsers table but it's being generated blank
Colin
@cuken
Apr 21 2016 20:48
I don't think I can hardcode a user inside the db because it uses the password hash
Colin
@cuken
Apr 21 2016 21:16
I think I'm close @GeertvanHorrik was able to hack a user in, but not able to apply rolls to him