Monday, September 19, 2016

Invalid JWT token. Could not resolve issuer token.

For the second time in three years. I have had the pleasure of encounter a "Invalid JWT token. Could not resolve issuer token." Error. The error comes from a provider-hosted add-in which worked fine the day before. The last time I got the error, I ended up recreate my client ID and client secret both in SharePoint online and need to update my web.config. But this year I was keen on finding a solution! After some time to even understand the error message. I found this article "Replace an expiring client secret in a SharePoint Add-in" https://msdn.microsoft.com/en-us/library/office/dn726681.aspx. Article goes step-by-step how to update your client secret. I have updated the script, as I allready knew my add-in name.

#set the name of my add-in
$displayName = "governanceapp"
Connect-MsolService
$appentry = Get-MsolServicePrincipal -all  | ? { $_.DisplayName -eq $displayName}
$principalId = $appentry.AppPrincipalId
$bytes = New-Object Byte[] 32
$rand = [System.Security.Cryptography.RandomNumberGenerator]::Create()
$rand.GetBytes($bytes)
$rand.Dispose()
$newClientSecret = [System.Convert]::ToBase64String($bytes)
New-MsolServicePrincipalCredential -AppPrincipalId $principalId -Type Symmetric -Usage Sign -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $principalId -Type Symmetric -Usage Verify -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $principalId -Type Password -Usage Verify -Value $newClientSecret
#this go into the web.config
$newClientSecret

Saturday, August 27, 2016

New event in the Danish SharePoint community SPBG ERFA omkring SharePoint Framework

A new event in the Danish SharePoint community has been posted on the user group website. Read more about SharePoint Bruger Gruppe (SPBG): Møder at http://ift.tt/2bnC4n9

Thursday, August 25, 2016

SPBG ERFA omkring SharePoint Framework

Hej SharePointer

Kom til SPBG erfa møde onsdag den 21. september, i København, og mød Per Jakobsen. Per er Principal Developer fra ProActive. Per vil give en introduktion til det nye SharePoint Framework og om de nye teknologier som det bygger på. Vi afholder mødet hos KMD fra kl. 17:00 til ca. 19 tiden. S.U den 19. septmenber. Tilmelding sker på https://www.meetup.com/Danish-SharePoint-User-Group-SPBG/

Husk vi flyttet til meetup.com, se mere her https://www.meetup.com/Danish-SharePoint-User-Group-SPBG/

Friday, June 24, 2016

SPBG Office 365 Dev Camp 2016

Kom til et gratis heldags arrangement omkring udvikling i Office 365 i København den 16. august 2016.

På dagen bliver der givet en introduktion til ASP.NET Core 1.0 og gennemgår Office 365 Dev Patterns & Practices (PnP) (http://dev.office.com/patterns-and-practices). Kendskab til SharePoint/Office 365 udvikling ikke nødvendig!

Agenda:

  • ASP.NET Core 1.0 introduktion niveau.
  • Hvad er Office 365 Dev Patterns & Practices (PnP) og basis operationer.
  • PnP Timer Job Framework.
  • Authentication Manager.
  • Site Provisioning Framework og PnP PowerShell.

Read more about the event here https://devcamp2016.eventbrite.com

Thursday, June 23, 2016

New event in the Danish SharePoint community SPBG Office 365 Dev Camp 2016

A new event in the Danish SharePoint community has been posted on the user group website. Read more about SharePoint Bruger Gruppe (SPBG): Møder at http://ift.tt/28RJ25l

Tuesday, May 10, 2016

SharePoint dinner 09/06/2016

Så er det tid til SharePoint dinner i København, mere præcist den torsdag 9. juni. Denne gang afholder vi det på TGI Fridays (http://www.tgifridays.dk/).
Læse mere om event her http://spbg.dk/Lists/Mder/DispForm.aspx?ID=85
Hvis du ikke ved hvad SharePoint dinner gå ud på kan du læse om det her "Hvad er SharePoint dinner" (http://sharepointbrugergruppe.dk/Pages/Hvad%20er%20SharePoint%20dinner.aspx)
 
Obs! Tilmelding sker på https://spdinner20160609.eventbrite.com og seneste den mandag den 6. juni.

Monday, May 9, 2016

New event in the Danish SharePoint community SharePoint dinner 09/06/2016

A new event in the Danish SharePoint community has been posted on the user group website. Read more about SharePoint Bruger Gruppe (SPBG): Møder at http://ift.tt/1rD7Kdm

Wednesday, April 27, 2016

Use “runas” when testing different user roles

A common scenario when testing SharePoint is to switch between multiple user accounts to imitate different user roles. A normal way to do this is to use SharePoints “sign in as a different user” function or right click on a browser/program and use the “run as a different user” function in windows.

The first method can result in you are sign in as the current user when you are browsers other resources dependent on your internet explorer settings.

The second will solve this problem. But you need to enter username and password each time you start a new browser session.

To overcome you need to enter username and password each time. You can use the “runas” program call from a .bat file. With the syntax like this, can you indicate the username. And you only need to enter the password the first time you run the .bat file:

runas /user:[domain\username] /savecred “[path to browser/program]”

e.g.

runas /user:domain\SP13TestAO1 /savecred "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

And create a .bat file for each user role, it is easy to switch between user session:

image

Monday, April 25, 2016

WebAPI plain text response

I got a problem where the solution was to create a globe JavaScript object and I need to render the data on the server.

I would like to use the JavaScript object like:

<span id="text"></span>
<script>
var d = document.getElementById("text");
d.innerText = resources.hello;
</script>

I started by creating a WebAPI controller and return a string through the Ok method. And end up with this:

clip_image001

This is not JavaScript and there for I can’t use it.

I found an article by Mike Wasson (http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/action-results). Where he creates a new IHttpActionResult.

With this new class. I can control the output. So it will be like this:

clip_image002

Tuesday, March 15, 2016

Remove all custom user action

On my current project I use the PnP framework provisioning to add custom user action to my web. The web gets quickly fell up the custom user action weird places and it is hard to see which of the custom user action is the latest and therefore the ones I should test. Therefore, I use this PowerShell snippet to delete all, before I re-run my provisioning.

$web = get-spweb https://apps.dev2.net/sites/dev1/
$customActionIds = $web.UserCustomActions | select id
$customActionIds | % {
  $web.UserCustomActions.Item($_.Id).Delete()
}

Monday, February 29, 2016

Office 365 Saturday update

With less than two weeks to Office 365 Saturday event, Saturday, March 12. And with a fully packed schedule on the latest trends for SharePoint, Azure Power BI, Power App, Governance and CRM. As well as with a good opportunity to network with both Danish and international persons. It will be an exciting day. Therefore, we are looking forward to seeing you We therefore look very much to see you. Tickets are still available and we suggest you to invite others in your network to join in on the day. There are still tricks back and therefore an invitation to invite others in your network to join in the day.

Read more about the event and register here http://spsevents.org/city/Copenhagen/Copenhagen2016/

Saturday, January 16, 2016

New event in the Danish SharePoint community Office 365 Saturday

A new event in the Danish SharePoint community has been posted on the user group website. Read more about SharePoint Bruger Gruppe (SPBG): Møder at http://ift.tt/1RWbLCQ

Wednesday, January 13, 2016

The preview is here, Remote Desktop with support for Continuum

I’m a big Windows 10 mobile fan. No doubt about that and the idea behind Continuum really make me excited. I believe Continuum will change the way I work. But the one app I was missing was Remote Desktop with support for Continuum. The wait is over Microsoft has released, a preview version of Remote Desktop with support for Continuum. Read windowscentral.com article about here and download the new preview version here