Setup Xamarin iOS to Login to Azure ADAL and Sharepoint Online

misc1This project takes a lot from this and makes changes for the new API (you must register your SharePoint application with Azure AD).  This document sets up Azure AD for Sharepoint Online.

When using the ADAL package on the Xamarin iPhone emulator, it requires quite a process to get up and running.  Installing ADAL requires the NuGet Package  “Microsoft.IdentityModel.Clients.ActiveDirectory”. Once that’s installed, you must create an authenticator service to assist with authenticating.

Continue reading “Setup Xamarin iOS to Login to Azure ADAL and Sharepoint Online”

Quick Way to Create C# Models from SQL Tables

misc1Recently, I was working on a project which used SQLCommands and I need to import a few SQL tables to start using as models. The tables were pretty large so I didn’t want to type them in manually. After a bit of searching, I found something on Stack Overflow that helped me out. Link

The code is pretty simple. You execute it against your table and it’ll output a C# class with all properties based on the table’s columns:

Continue reading “Quick Way to Create C# Models from SQL Tables”

ASP.Net Identity Generate Token Weirdness (Tokens become invalid seemingly at a random interval)

misc1We’re working on an ASP.Net project that uses Identity to handle user authorization and had an interesting issue when creating temporary email confirmation tokens.

The tokens are generated via the Use-Manager’s function “GenerateEmailConfirmationTokenAsync”. Then we add that token to a link which is emailed to the user.

Periodically, these tokens were coming back as being invalid and a search on the issue came up with some interesting reasons.

Continue reading “ASP.Net Identity Generate Token Weirdness (Tokens become invalid seemingly at a random interval)”

Streaming Video Content to a Browser using Web API

misc1Recently, a client reached out to me that their video streaming wouldn’t allow for seeking (fast-forward & rewind).  Not knowing a lot about streaming, I did some google searching and found out that if the API is not setup to support seeking, then it will not work.

I found a great starting point for this:

https://www.codeproject.com/Articles/820146/HTTP-Partial-Content-In-ASP-NET-Web-API-Video

Continue reading “Streaming Video Content to a Browser using Web API”

ASP.Net Identity EF Users Primary Key Change

misc1Recently, I worked on converting a .Net API from a 3rd party authentication mechanism to internal and we chose to use the Identity framework.  By default, Identity uses a string as the primary key for the AspNetUsers table and that was an issue because our current users table used a long (and there were a lot of foreign key references to it).

Continue reading “ASP.Net Identity EF Users Primary Key Change”