Do I really need to understand what OWIN Claims are?
Of course. OWIN is the mechanism that injects Identity into your web application. Claims are bits of information about a user. This information is often used to authorize access to resources similar to a role. Claims are a very common feature in modern authentication/authorization.
EDIT: I'm currently struggling with how to activate email confirmation. Within IdentityConfig.vb, the function SendAsync asks me to "Plug in your email service here to send an email". I have mailSettings set up in Web.Config and know how to send an email via code, but I've no idea what "plug in your email service" means.
You are struggling with the concept of an Interface. "Plug in" means add the code you typically use to send emails. Basically, the "Individual Account" template developer provided a place where you get to insert your email client code.
First, take a look at the IdentityMessage input parameters of the SendAsync method. The Identity API, through configuration, populates these values.
'
' Summary:
' Represents a message
Public Class IdentityMessage
Public Sub New()
'
' Summary:
' Destination, i.e. To email, or SMS phone number
Public Overridable Property Destination As String
'
' Summary:
' Subject
Public Overridable Property Subject As String
'
' Summary:
' Message contents
Public Overridable Property Body As String
End Class
You get to use these three properties to populate the email message. However, you must know how to configure your email client according to the email service provider you are using.
Below is an SmtpClient example that uses gmail. Your configuration will most likely differ. Keep in mind, the code below is not production ready but it should give you the general idea.
Public Class EmailService
Implements IIdentityMessageService
Public Function SendAsync(message As IdentityMessage) As Task Implements IIdentityMessageService.SendAsync
' Plug in your email service here to send an email.
Dim Smtp_Server As New SmtpClient
Dim e_mail As New MailMessage()
Smtp_Server.UseDefaultCredentials = False
Smtp_Server.Credentials = New Net.NetworkCredential("******@gmail.com", "password")
Smtp_Server.Port = 587
Smtp_Server.EnableSsl = True
Smtp_Server.Host = "smtp.gmail.com"
e_mail = New MailMessage()
e_mail.From = New MailAddress("******@gmail.com")
e_mail.To.Add(message.Destination)
e_mail.Subject = message.Subject
e_mail.IsBodyHtml = False
e_mail.Body = message.Body
Smtp_Server.Send(e_mail)
Return Task.FromResult(0)
End Function
End Class