Dave Shepherd
Posts: 0
Joined: Fri May 30, 2014 9:22 am

Azure Relay Rest Service - Connect securely from Appery/OAuth or ?

Hi.

Please assist me in any way possible - I am going around in circles. Let me set out the scenario and what I have done so far and what I want to achieve.

I have a on-premise WCF service that is relayed on the Azure Service Bus as a REST service. I can connect to it and read data perfectly from Appery when there is no authorization required on the relay.

I must secure the service and have implemented

in the web.config of the service.

I have also created a Service Identity in Azure Access Control Service and created a
Simple Web Token.

The appery app is only for employees so no logon is required, however still need the relay service to be secure.

Using the SWT is one have of having the client app authenticating against the service without the need to log on as a user.

I have read the tutorials on the appery website, but struggling to work out how to aquire a token from ACS and then pass it on to the webservice. All code samples on web are in C# and that doest help me.

Regards
Dave

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Azure Relay Rest Service - Connect securely from Appery/OAuth or ?

Hello Dave,

Could you please clarify have you set it all on your service? Does it work? Please detail what did you do in Appery.io and what you can't do?

Dave Shepherd
Posts: 0
Joined: Fri May 30, 2014 9:22 am

Azure Relay Rest Service - Connect securely from Appery/OAuth or ?

Hi.

In the app.config of the service when I set webHttpRelayBinding to
security relayClientAuthenticationType="None" - appery can connect to service and display results.

When changing the above setting to
security relayClientAuthenticationType="RelayAccessToken" - appery cannot connect and gives me a 401 message (Missing token)

This is the expected result, as the service has now been secured.

My problem now is I dont know what to do in appery to be able to connect securely to this service.

I know I have to retrieve the token from ACS and present it to the service.
Thats where I need your input.

Thanks !

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Azure Relay Rest Service - Connect securely from Appery/OAuth or ?

Hello Dave,

Could you please detail, you know where to get the token, at what address, but do not know how to use it in Appery.io? Or don't know how it get?

Dave Shepherd
Posts: 0
Joined: Fri May 30, 2014 9:22 am

Azure Relay Rest Service - Connect securely from Appery/OAuth or ?

Hi Eugene
Yes, I know what the address is, but don't know how to get it in appery.io from Azure ACS and then to present the token to the relay from within appery.io.

I am quite willing to share the project as well as all the other details that you mm a need in assisting me with this.

Azure is going to play a big part of our architecture and having this ability to connect back to on-premise wcf REST services is critical. Hence getting this to work in appery.io is vital in continuing to use appery.io as a Dev platform.

Your help is greatly appreciated.

Dave

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Azure Relay Rest Service - Connect securely from Appery/OAuth or ?

Hello Dave,

We are sorry for radio silence here. Could you please describe the whole process? To what address what do you send, what do you get in return, what do then, etc. and we will try to advise how to implement this in Appery.io.

Dave Shepherd
Posts: 0
Joined: Fri May 30, 2014 9:22 am

Azure Relay Rest Service - Connect securely from Appery/OAuth or ?

Hi Evgene.

I have decided to try get everything to work in C# first upon success of that will give Appery a go again. May require your assitance then.

Currently I have managed to get the token from ACS, now its a matter of passing it to the WCF service.

Regards
Dave

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Azure Relay Rest Service - Connect securely from Appery/OAuth or ?

Hi Dave,

Thank you for the update.
Let us know if you need any assistance with Appery.io.

Dave Shepherd
Posts: 0
Joined: Fri May 30, 2014 9:22 am

Azure Relay Rest Service - Connect securely from Appery/OAuth or ?

Thanks - probably/definitely will require some assistance :)
Have a great weekend.

Dave Shepherd
Posts: 0
Joined: Fri May 30, 2014 9:22 am

Azure Relay Rest Service - Connect securely from Appery/OAuth or ?

Hi

I have made some progress. Managed to get it to work in the .Net environment.

If I copy and paste the token into the Authorization parameter in the header of the request - service in Appery and Test the service, I get the result that I expect i.e. The service returns the required data.

Here is an extract of the what the token looks like:
WRAP access_token="net.windows.servicebus.action=Send&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2 .....................

What I am asking now is how do I request a token from within appery.io.

I am using password request and this what MS have as how to form the request using HTTP POST - but this is where I am getting unstuck.
http://msdn.microsoft.com/en-us/libra...

These are my details that you will required to request a token:
wrap_name = "serviceclient"
wrap_password = "YElZuSuP+sAwzjUJ351GewFU+2t0haMpuoy07W6dyTk="
wrap_scope = "http://sstestrh.servicebus.windows.ne..."

Issuer address https://sstestrh-sb.accesscontrol.win...

So my problem is how to request a token within appery?

Thanks a mil

Dave

Return to “Issues”