SQL Server -tietokannan käsittely ASP.NET MVC -sovelluksessa Web API -rajapinnan kautta
Mattila, Kati (2019)
Mattila, Kati
2019
All rights reserved. This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-2019121627036
https://urn.fi/URN:NBN:fi:amk-2019121627036
Tiivistelmä
Opinnäytetyön tavoitteena oli ohjelmoida toimeksiantajayritykselle ASP.NET-pohjainen käyttöliittymä ja ohjelmointirajapinta. Toimeksiantaja halusi pysyä nimettömänä. Tarkoitus oli luoda ASP.NET-sovellus, jolla Microsoftin SQL Serverissä sijaitsevaa tietokantaa voitaisiin käyttää tietoturvallisesti rajapinnan kautta. Tutkimuskysymykset liittyivät tietoturvallisuuteen ja siihen, mikä olisi sopiva tapa toteuttaa ohjelmointirajapinta .NET-ympäristössä. Toimeksiantajalla ei vielä ollut tämänkaltaista sovellusta ja työn tulos on tekniikkademo, jota tullaan mahdollisesti käyttämään tulevaisuuden projekteissa.
Työssä tutkitaan Microsoftin .NET-ympäristöä, ohjelmointirajapintoja, tietokantoja ja ASP.NET-sovelluksen tietoturvaa. .NET-ympäristöön sopiva sovellus oli toimeksiantajan rajaus, sillä heidän nykyiset sovelluksensa toimivat .NET-ympäristössä. Käyttöliittymä päädyttiin tekemään ASP.NET MVC -mallia hyödyntäen ja ohjelmointirajapinnaksi valittiin Web API, joka noudattaa REST-arkkitehtuuria. Web API koettiin sopivaksi ohjelmointirajapinnaksi .NET-ympäristöön. Tietokantoja käydään läpi yleisellä tasolla ja selvitetään myös, kuinka luoda tietokanta käyttäen hyväksi ASP.NET-sovelluksessa kirjoitettua luokkakoodia. Tietoturvallisuuteen liittyen tutkittiin sovelluksiin kohdistuvia yleisimpiä uhkia ja ratkaisuja niihin.
Opinnäytetyössä onnistuttiin ohjelmoimaan toimeksiantajalle tekniikkademo, jossa käytetään hyödyksi ASP.NET MVC -mallia sekä Web API:a tietoturva-asiat mahdollisimman hyvin huomioon ottaen. The aim of this thesis was to program ASP.NET-based web application which uses Microsoft SQL Server database via Web API. All functions should be secured so anonymous user should not be able to make any changes to database. The commissioner was interested how this kind of application would work because they did not have anything like this before. They wanted to stay anonymous.
A theory part of this thesis consists of Microsoft .NET environment, Application Programming Interfaces (API’s), databases and security of ASP.NET-application. .NET environment was researched because the commissioner works with .NET-applications so they defined that application should work in .NET environment.
Web application was programmed with ASP.NET MVC -model and API was created with Web API. Web API works well in .NET environment and MVC design pattern was easy and efficient to work with. Databases were explored generally. Entity Framework Code First approach was also clarified. In a security chapter, most common threats for web application were walked through and how to prevent from them.
In this thesis ASP.NET MVC -application and API were successfully programmed. Connection from application to Microsoft SQL Server was made with security. The result will be possibly used as a technology demonstration in the commissioner’s future projects.
Työssä tutkitaan Microsoftin .NET-ympäristöä, ohjelmointirajapintoja, tietokantoja ja ASP.NET-sovelluksen tietoturvaa. .NET-ympäristöön sopiva sovellus oli toimeksiantajan rajaus, sillä heidän nykyiset sovelluksensa toimivat .NET-ympäristössä. Käyttöliittymä päädyttiin tekemään ASP.NET MVC -mallia hyödyntäen ja ohjelmointirajapinnaksi valittiin Web API, joka noudattaa REST-arkkitehtuuria. Web API koettiin sopivaksi ohjelmointirajapinnaksi .NET-ympäristöön. Tietokantoja käydään läpi yleisellä tasolla ja selvitetään myös, kuinka luoda tietokanta käyttäen hyväksi ASP.NET-sovelluksessa kirjoitettua luokkakoodia. Tietoturvallisuuteen liittyen tutkittiin sovelluksiin kohdistuvia yleisimpiä uhkia ja ratkaisuja niihin.
Opinnäytetyössä onnistuttiin ohjelmoimaan toimeksiantajalle tekniikkademo, jossa käytetään hyödyksi ASP.NET MVC -mallia sekä Web API:a tietoturva-asiat mahdollisimman hyvin huomioon ottaen.
A theory part of this thesis consists of Microsoft .NET environment, Application Programming Interfaces (API’s), databases and security of ASP.NET-application. .NET environment was researched because the commissioner works with .NET-applications so they defined that application should work in .NET environment.
Web application was programmed with ASP.NET MVC -model and API was created with Web API. Web API works well in .NET environment and MVC design pattern was easy and efficient to work with. Databases were explored generally. Entity Framework Code First approach was also clarified. In a security chapter, most common threats for web application were walked through and how to prevent from them.
In this thesis ASP.NET MVC -application and API were successfully programmed. Connection from application to Microsoft SQL Server was made with security. The result will be possibly used as a technology demonstration in the commissioner’s future projects.