Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Night Shade
Jan 13, 2013

Old School

The Wizard of Poz posted:

I came across that but I can't find any documentation whatsoever to support the theory that it can be used to build an OAuth 2.0 server. This is the frustration I keep encountering, it seems like no one in the world is interested in building their own OAuth server, they're only interested in talking to existing OAuth servers like Google and Facebook etc.

https://github.com/DotNetOpenAuth/DotNetOpenAuth/wiki/Security-scenarios#developing-a-user-specific-authorization-server and down

Adbot
ADBOT LOVES YOU

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Exactly what I needed, thank you!

RICHUNCLEPENNYBAGS
Dec 21, 2010

The Wizard of Poz posted:

Open ID is not the same as OAuth 2.0.

Edit: and even if it were, the documentation on same is virtually non-existent.

Fair enough. Sorry.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

RICHUNCLEPENNYBAGS posted:

Fair enough. Sorry.

Not at all, I'm struggling to wrap my head around all this and the myriad of terms that get bandied about far too often appear to be interchangeable or their definitions become muddled. As I read more about OAuth 2.0 I'm starting to think maybe OpenID is what I need after all. It's all very convoluted.

putin is a cunt fucked around with this message at 05:51 on Aug 17, 2015

Gul Banana
Nov 28, 2003

RICHUNCLEPENNYBAGS posted:

My program exists to reflect over arbitrary assemblies... how can I deal with resolving dependencies? I think I can pretty much assume the dependencies are always in the same directory as the assembly I'm reflecting over.

I don't think ReflectionOnlyLoad will work because I need to reflect into the depndencies to get some classes.

It seemed like it might work to switch to LoadFrom from LoadFile (it worked in a test), but then it didn't work in the actual program. >:[

AppDomain.AssemblyResolve
read up on the Load and LoadFrom contexts, pick one, then handle that event to supply dependencies from arbitrary files (since yours are in a known location) i've done this before & it worked fine; just make sure to unload the appdomain when done or you'll be re-using the existing dep resolutions

none of this will work in core CLR, but that's a bridge to cross someday..

Night Shade
Jan 13, 2013

Old School

The Wizard of Poz posted:

Not at all, I'm struggling to wrap my head around all this and the myriad of terms that get bandied about far too often appear to be interchangeable or their definitions become muddled. As I read more about OAuth 2.0 I'm starting to think maybe OpenID is what I need after all. It's all very convoluted.

I'm not 100% on this but my take on them both is that:
OAuth allows a user to authorise some application access to their stuff without needing to give that application their password.
OpenID allows users to authenticate themselves using a third party (Google etc.) and I think it can combine with OAuth in a single call to also ask for authorisation to that third party's data

To do a typical federated identity sign in, you use OpenID to ask Google to authenticate your user, and then use OAuth to get authorisation from the user to read more info about them than just their email address.

Chances are someone is going to come in here and correct me on that.

Anyway this is starting to sound like an XY problem, so what is it that you're trying to do?

EssOEss
Oct 23, 2006
128-bit approved
I have some code I am moving into a portable library targeting .NET 4.6, UWP and ASP.NET 5. I would like this code to take advantage of some .NET 4.6 classes if running on .NET 4.6 but not elsewhere - sort of like my own variant of Platform Extensions. The .NET 4.6 classes are my own, and I only want them used if the library containing them is loaded.

How should I best accomplish this? What is the standard approach?

EssOEss
Oct 23, 2006
128-bit approved
In fact, it seems that I am having trouble understanding some basic concept of portable class libraries.

I have made a portable library targeting .NET 4.6, UWP and ASP.NET 5. In this library, I added a class that does some basic boring stuff with the filesystem (creates a directory).

Now I am trying to use this class from a .NET 4.6 console app. I reference my portable library as a project reference. All is well. I run my console app. It explodes!

quote:

Could not load file or assembly 'System.IO.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Okay, fine - it seems that this library comes from the Microsoft.NETCore NuGet package. Presumably it explodes because my console application does not have it installed. So I go do that. But no!

quote:

Could not install package 'Microsoft.NETCore.Platforms 1.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

What. Am I missing something obvious?

Kekekela
Oct 28, 2004

This is my first time hearing this term but after googling it, I think I will be using it extensively going forward. :downs:

LiterallyAnything
Jul 11, 2008

by vyelkin

SirViver posted:

HA, I found the bug!

I was trying to create a minimal repro case, and the error somehow seemed to be related to the specific assembly the referenced member's type is defined in - if I put the same dummy class I used for testing in in a new class library it worked. Having members referencing both the "broken" assembly and the newly created one resulted in only the broken-assembly-members being screwed up after EnC.

On a hunch I decided to make sure the assembly properties are equal between the both and suddenly I could reproduce the error even with the new class library. Turns out if you use an auto-generated assembly version number EnC breaks member references to types defined in that assembly.


The repro code is literally this:

Main console project...

Program.cs
C# code:
using EnCClassLibrary;

namespace EditAndContinueConsoleTest
{
	class Program
	{
		static SomeClass someClass;

		static void Main(string[] args)
		{
			someClass = new SomeClass(); 
			someClass.SomeProperty = 1; // Step until here, EnC below, continue execution --> will throw NullReferenceException

			if (true) { } // EnC this to false (or whatever - specifics don't matter, just trigger EnC)
		}
	}
}
...referencing the "EnCClassLibrary" (doesn't matter if via project or assembly reference), in which you have

AssemblyInfo.cs
C# code:
...
[assembly: AssemblyVersion("1.0.*")]
...
SomeClass.cs
C# code:
namespace EnCClassLibrary
{
    public class SomeClass
    {
		public int SomeProperty { get; set; }

		public SomeClass()
		{

		}
    }
}

I have a question about this if you don't mind, although it's not really thread relevant. However it's not letting me PM you, saying that you've opted not to receive PMs. Do you have an e-mail address I can reach you at?

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Kekekela posted:

This is my first time hearing this term but after googling it, I think I will be using it extensively going forward. :downs:

You'll see examples of it constantly if you start reading/contributing to Stack Overflow. People decide they have a solution to their problem and ask how to implement their solution, when their solution is awful.

SirViver
Oct 22, 2008

Brady posted:

I have a question about this if you don't mind, although it's not really thread relevant. However it's not letting me PM you, saying that you've opted not to receive PMs. Do you have an e-mail address I can reach you at?
That's because PMs are a Plat... ohh, I seem to have mysteriously acquired Platinum, which also explains the report buttons suddenly showing up. Assuming someone bought it for me, thanks! - whoever you are.

Anyway, PMs are now enabled.

SirViver
Oct 22, 2008

ljw1004 posted:

SirVivier, thanks for the clean and simple bug report. I took the liberty of filing it on github: https://github.com/dotnet/roslyn/issues/4575. (Edit: wow, more of the compiler devs are piling on. Looks like auto-generated assembly versions have wider implications.)
Nice to see this get some attention :). Though, truth be told, I'll probably simply revert our assemblies to fixed version numbers (or ones written during the actual release package build - duh), as the generated ones serve no real purpose anyway. A few years back I had enabled them with the intention that it's easier to verify the assembly installed at the customer actually being the one delivered in the release package (to rule out hosed up installs or amateur-level tampering), but that issue arose exactly never.

If you do end up deprecating this feature, as seems to be discussed in the linked github issues, just remember to also remove this comment from the generated AssemblyInfo.cs
pre:
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
...and adjust the MSDN documentation, though I'm sure you already knew that.

SirViver fucked around with this message at 18:56 on Aug 17, 2015

LiterallyAnything
Jul 11, 2008

by vyelkin

SirViver posted:

That's because PMs are a Plat... ohh, I seem to have mysteriously acquired Platinum, which also explains the report buttons suddenly showing up. Assuming someone bought it for me, thanks! - whoever you are.

Anyway, PMs are now enabled.

Consider it a "thank you" for all the helpful posts.

Kekekela
Oct 28, 2004

Ithaqua posted:

You'll see examples of it constantly if you start reading/contributing to Stack Overflow. People decide they have a solution to their problem and ask how to implement their solution, when their solution is awful.

I've got like 7000 points on SO, not sure how I never came across it.

e: to be clear, I definitely see the scenario play out all the time, I've just never heard it called that

Kekekela fucked around with this message at 00:58 on Aug 18, 2015

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Kekekela posted:

This is my first time hearing this term but after googling it, I think I will be using it extensively going forward. :downs:

Haha me too!

Night Shade posted:

I'm not 100% on this but my take on them both is that:
OAuth allows a user to authorise some application access to their stuff without needing to give that application their password.
OpenID allows users to authenticate themselves using a third party (Google etc.) and I think it can combine with OAuth in a single call to also ask for authorisation to that third party's data

To do a typical federated identity sign in, you use OpenID to ask Google to authenticate your user, and then use OAuth to get authorisation from the user to read more info about them than just their email address.

Chances are someone is going to come in here and correct me on that.

Anyway this is starting to sound like an XY problem, so what is it that you're trying to do?

I think you're right, let me take a step back. We have a customer database that includes, among other details, a username and password for each of our customers. We would like to use this database to provide authentication for potentially many websites. To achieve this, I'd like to make some kind of authentication service that can be called remotely to authenticate a user and they will then be logged in across all the related websites without having to re-enter their credentials for each one. I assume this would some kind of token system but I'm not sure how to plug it all together.

brap
Aug 23, 2004

Grimey Drawer
I'm working on an MVC 6 Web API project and I'd like to profile it to find out where my performance bottlenecks are. However, when I go to the Debug menu -> Start Diagnostic Tools without Debugging and go through all the steps there, I hit a wall. When it asks me which project I want to profile, the listing says "No launchable projects are available for profiling."

What should I do? Would something like MiniProfiler work if I dropped it in?

Mr Shiny Pants
Nov 12, 2012

The Wizard of Poz posted:

Haha me too!

We would like to use this database to provide authentication for potentially many websites.

Your own or also third party websites?

EssOEss
Oct 23, 2006
128-bit approved

EssOEss posted:

What. Am I missing something obvious?

Manually sticking a project.json file into the .NET 4.6 project resulted in the runtime error resolving but now, I am getting errors like "cannot resolve IConfigurationSectionHandler" and "The referenced component System could not be found". This is ridiculous.

EssOEss fucked around with this message at 06:56 on Aug 18, 2015

Night Shade
Jan 13, 2013

Old School

The Wizard of Poz posted:

I think you're right, let me take a step back. We have a customer database that includes, among other details, a username and password for each of our customers. We would like to use this database to provide authentication for potentially many websites. To achieve this, I'd like to make some kind of authentication service that can be called remotely to authenticate a user and they will then be logged in across all the related websites without having to re-enter their credentials for each one. I assume this would some kind of token system but I'm not sure how to plug it all together.

The Wizard of Poz posted:

As I read more about OAuth 2.0 I'm starting to think maybe OpenID is what I need after all. It's all very convoluted.

I'm pretty sure you're right, and that what you want to be doing is building an OpenID provider over your customer database and making the related websites relying parties. I couldn't easily find any documentation on doing that with DotNetOpenAuth but I did find a sample implementation at https://github.com/DotNetOpenAuth/DotNetOpenAuth.Samples/tree/master/src/OpenID/OpenIdProviderMvc - good luck!

Kekekela posted:

This is my first time hearing this term but after googling it, I think I will be using it extensively going forward. :downs:

:pseudo:

SirViver
Oct 22, 2008

Kekekela posted:

Night Shade posted:

XY problem
This is my first time hearing this term but after googling it, I think I will be using it extensively going forward. :downs:
Wait, while I'm familiar with the term, is it intentional that when you pronounce X-Y it's sorta kinda like "ask why" :v:

Kekekela
Oct 28, 2004
This reminds me of a horrible Menendez brothers joke.

e: :captainpop: are those....nested quotes?

Kekekela fucked around with this message at 11:55 on Aug 18, 2015

Mr Shiny Pants
Nov 12, 2012

SirViver posted:


Wait, while I'm familiar with the term, is it intentional that when you pronounce X-Y it's sorta kinda like "ask why" :v:

This is what I thought also. :)

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Mr Shiny Pants posted:

This is what I thought also. :)

Must be an accent thing, because "ex" and "ask" sound nothing alike.

Mr Shiny Pants
Nov 12, 2012

Ithaqua posted:

Must be an accent thing, because "ex" and "ask" sound nothing alike.

Listen to some rap music ;)

You are right, but with some imagination you can.

SirViver
Oct 22, 2008

Ithaqua posted:

Must be an accent thing, because "ex" and "ask" sound nothing alike.
Yea, I was mostly referring to an American accent with sloppy pronunciation of "ask" as "aks" or "axe" :)

Boz0r
Sep 7, 2006
The Rocketship in action.
I just upgraded from Visual Studio 2013 to 2015, and I'm missing a feature. In a small line above each class and function definition, it mentioned how many references to the function, who created it, and a little more. I also have ReSharper installed, and I don't remember installing anything else in 2013. Anyone know what I'm talking about?

No Safe Word
Feb 26, 2005

Boz0r posted:

I just upgraded from Visual Studio 2013 to 2015, and I'm missing a feature. In a small line above each class and function definition, it mentioned how many references to the function, who created it, and a little more. I also have ReSharper installed, and I don't remember installing anything else in 2013. Anyone know what I'm talking about?

it's called codelens if that helps, it was built-in to visual studio but I immediately turned it off :v:

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Boz0r posted:

I just upgraded from Visual Studio 2013 to 2015, and I'm missing a feature. In a small line above each class and function definition, it mentioned how many references to the function, who created it, and a little more. I also have ReSharper installed, and I don't remember installing anything else in 2013. Anyone know what I'm talking about?

Did you switch to VS 2015 community or something? Code Lens is in VS2015 Professional and Enterprise now.

Chamook
Nov 17, 2006

wheeeeeeeeeeeeee

Boz0r posted:

I just upgraded from Visual Studio 2013 to 2015, and I'm missing a feature. In a small line above each class and function definition, it mentioned how many references to the function, who created it, and a little more. I also have ReSharper installed, and I don't remember installing anything else in 2013. Anyone know what I'm talking about?

I gained this feature when I upgraded from VS2013 to 2015, and it is a magical wonderful thing and I will maybe be able to convince my coworkers to write decent commit messages now, but yeah it was in 2013 ultimate and unless you went all the way down to community you should still have it in 2015.

Boz0r
Sep 7, 2006
The Rocketship in action.
Yeah, it's the Community Edition. It was top of the list in Dreamspark, and it said it was pretty much the same as Enterprise so I just picked that, while Enterprise was just underneath it. Trust no one.

brap
Aug 23, 2004

Grimey Drawer
Yay Microsoft and version segmentation. You still have Source Control -> Annotate for what it's worth.

Night Shade
Jan 13, 2013

Old School

Boz0r posted:

Yeah, it's the Community Edition. It was top of the list in Dreamspark, and it said it was pretty much the same as Enterprise so I just picked that, while Enterprise was just underneath it. Trust no one.

On the bright side given you have access to the Enterprise edition you should be able to just install that over the top of your current install and upgrade it. At least I did that to my copy of 2013 when I got bumped from Pro to Premium and it worked OK, didn't even break addins.

Night Shade
Jan 13, 2013

Old School
Hey Poz one of the other guys at work just pointed me at Thinktecture IdentityServer as an alternative to DotNetOpenAuth, might be worth looking into as well.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Mr Shiny Pants posted:

Your own or also third party websites?

All will be under the control of the company I work for, so no third party sites.

Night Shade posted:

I'm pretty sure you're right, and that what you want to be doing is building an OpenID provider over your customer database and making the related websites relying parties. I couldn't easily find any documentation on doing that with DotNetOpenAuth but I did find a sample implementation at https://github.com/DotNetOpenAuth/DotNetOpenAuth.Samples/tree/master/src/OpenID/OpenIdProviderMvc - good luck!


:pseudo:

Night Shade posted:

Hey Poz one of the other guys at work just pointed me at Thinktecture IdentityServer as an alternative to DotNetOpenAuth, might be worth looking into as well.

Thanks mate, both of those look positive, especially IdentityServer. Very much appreciate your advice, cheers!

Mr Shiny Pants
Nov 12, 2012

The Wizard of Poz posted:

All will be under the control of the company I work for, so no third party sites.


I would seriously take a look at ADFS, it works pretty easily with MVC and the tooling is pretty nice.

It should support a custom SQL backend for storing your users.

Gul Banana
Nov 28, 2003

nuget continues to everything.

https://api.nuget.org/v3/index.json is 404 right now, and the 404 response contains XML not JSON!

Gul Banana
Nov 28, 2003

further: having one source un-contactable prevents any nuget upgrade or install operation in v3 even when no packages from that source are involved.

Boz0r
Sep 7, 2006
The Rocketship in action.

Kekekela posted:

The two ways I see are with a generic method:

code:
	public void ResetBoard<TTile>() where TTile : new(){
		...
		GameTiles[x,y] = new TTile();
		...
	}
code:
	foo.ResetBoard<OpenTile>();

I'm using this one, it seems the most elegant.

The GameTiles array is of type IGameTile. Can I enforce type safety on the function in some way, instead of casting TTile to IGameTile all the time?

Adbot
ADBOT LOVES YOU

Ika
Dec 30, 2004
Pure insanity

In C++ you could include a static_cast in the template function and it would refuse to compile if it weren't a derived type - not sure if something similar is possible in .NET.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply